1
0
mirror of https://codeberg.org/tenplus1/mobs_redo.git synced 2024-12-25 18:20:20 +01:00

better way to reset pause_timer with "stand" order

This commit is contained in:
tenplus1 2023-04-27 10:21:31 +01:00
parent 6af671997b
commit f5ccec9b60

View File

@ -25,7 +25,7 @@ local use_cmi = minetest.global_exists("cmi")
mobs = { mobs = {
mod = "redo", mod = "redo",
version = "20230426", version = "20230427",
intllib = S, intllib = S,
invis = minetest.global_exists("invisibility") and invisibility or {} invis = minetest.global_exists("invisibility") and invisibility or {}
} }
@ -3453,15 +3453,16 @@ function mob_class:on_step(dtime, moveresult)
self.pause_timer = self.pause_timer - dtime self.pause_timer = self.pause_timer - dtime
return if self.pause_timer <= 0 and self.order == "stand" then
elseif self.pause_timer < 0 and self.order == "stand" then
self.pause_timer = 0 self.pause_timer = 0
self:set_velocity(0) self:set_velocity(0)
self:set_animation("stand", true) self:set_animation("stand", true)
end end
return
end
-- run custom function (defined in mob lua file) - when false skip going any further -- run custom function (defined in mob lua file) - when false skip going any further
if self.do_custom and self:do_custom(dtime, moveresult) == false then if self.do_custom and self:do_custom(dtime, moveresult) == false then
return return