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
1 changed files with 8 additions and 7 deletions

15
api.lua
View File

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