mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2024-11-14 14:30:19 +01:00
better way to reset pause_timer with "stand" order
This commit is contained in:
parent
6af671997b
commit
f5ccec9b60
15
api.lua
15
api.lua
|
@ -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,13 +3453,14 @@ function mob_class:on_step(dtime, moveresult)
|
||||||
|
|
||||||
self.pause_timer = self.pause_timer - dtime
|
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
|
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
|
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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user