From 44ba08cb8be1d2484b8950e9125d9e93aadef3e1 Mon Sep 17 00:00:00 2001 From: epCode <64379263+epCode@users.noreply.github.com> Date: Fri, 14 Oct 2022 13:31:18 -0700 Subject: [PATCH] make die animation more smooth for all mobs --- mods/ENTITIES/mcl_mobs/api.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index b98c4836c..8a42d6cbb 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -1014,9 +1014,6 @@ local check_for_death = function(self, cause, cmi_cause) length = max(frames / speed, 0) + DEATH_DELAY set_animation(self, "die") else - local rot = self.object:get_rotation() - rot.z = pi/2 - self.object:set_rotation(rot) length = 1 + DEATH_DELAY set_animation(self, "stand", true) end @@ -3850,6 +3847,12 @@ local mob_step = function(self, dtime) end end + if self.state and self.state=="die" or check_for_death(self) then + local rot = self.object:get_rotation() + rot.z = ((pi/2-rot.z)*.2)+rot.z + self.object:set_rotation(rot) + end + if not player_in_active_range(self) then set_animation(self, "stand", true) self.object:set_velocity(vector.new(0,0,0))