From 622abd1486a5de5050805b46dc7c643ab34443ec Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Fri, 8 Jan 2021 10:16:33 +0000 Subject: [PATCH] hopefully fixed death animation crash when player away --- api.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api.lua b/api.lua index f4b44de..d132793 100644 --- a/api.lua +++ b/api.lua @@ -8,7 +8,7 @@ local use_cmi = minetest.global_exists("cmi") mobs = { mod = "redo", - version = "20210107", + version = "20210108", intllib = S, invis = minetest.global_exists("invisibility") and invisibility or {} } @@ -910,6 +910,7 @@ function mob_class:check_for_death(cmi_cause) local rot = self.animation.die_rotate and 5 self.attack = nil + self.following = nil self.v_start = false self.timer = 0 self.blinktimer = 0 @@ -917,7 +918,7 @@ function mob_class:check_for_death(cmi_cause) self.state = "die" self.object:set_properties({ pointable = false, collide_with_objects = false, - automatic_rotate = rot, + automatic_rotate = rot, static_save = false }) self:set_velocity(0) self:set_animation("die") @@ -3074,6 +3075,7 @@ function mob_class:mob_staticdata() if t ~= "function" and t ~= "nil" and t ~= "userdata" + and _ ~= "object" and _ ~= "_cmi_components" then tmp[_] = self[_] end @@ -3326,6 +3328,8 @@ function mob_class:on_step(dtime, moveresult) }} }]] +if self.state == "die" then return end ---------------- + if use_cmi then cmi.notify_step(self.object, dtime) end