From f5ccec9b6065308ff9a77778382aa3045db28687 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Thu, 27 Apr 2023 10:21:31 +0100 Subject: [PATCH] better way to reset pause_timer with "stand" order --- api.lua | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/api.lua b/api.lua index b81bcdb..687bdbc 100644 --- a/api.lua +++ b/api.lua @@ -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