Fix moving facement being reset
This commit is contained in:
parent
c86184e4e8
commit
8b42625ac3
@ -29,11 +29,12 @@ local function knockback(selfOrObject, dir, old_dir, strengh)
|
|||||||
if selfOrObject.mob_name then
|
if selfOrObject.mob_name then
|
||||||
object = selfOrObject.object
|
object = selfOrObject.object
|
||||||
end
|
end
|
||||||
|
local current_fmd = object:get_properties().automatic_face_movement_dir or 0
|
||||||
object:set_properties({automatic_face_movement_dir = false})
|
object:set_properties({automatic_face_movement_dir = false})
|
||||||
object:setvelocity(vector.add(old_dir, {x = dir.x * strengh, y = 3.5, z = dir.z * strengh}))
|
object:setvelocity(vector.add(old_dir, {x = dir.x * strengh, y = 3.5, z = dir.z * strengh}))
|
||||||
old_dir.y = 0
|
old_dir.y = 0
|
||||||
core.after(0.4, function()
|
core.after(0.4, function()
|
||||||
object:set_properties({automatic_face_movement_dir = -90.0})
|
object:set_properties({automatic_face_movement_dir = current_fmd})
|
||||||
object:setvelocity(old_dir)
|
object:setvelocity(old_dir)
|
||||||
selfOrObject.falltimer = nil
|
selfOrObject.falltimer = nil
|
||||||
if selfOrObject.stunned == true then
|
if selfOrObject.stunned == true then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user