diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2017-07-29 15:45:19 +0100 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2017-07-29 15:45:19 +0100 |
commit | 276c2fc0ceb73fdaddcb4f936d6f436aa9ac841a (patch) | |
tree | 97c11daad30eeda05083f8da5e77640e9eb59ba1 | |
parent | 8ad63d35d08b5dd08f2d4b6aecc0c39dc6caafc6 (diff) |
update death animation timers
-rw-r--r-- | api.lua | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -1,9 +1,9 @@ --- Mobs Api (26th July 2017) +-- Mobs Api (30th July 2017) mobs = {} mobs.mod = "redo" -mobs.version = "20170726" +mobs.version = "20170730" -- Intllib @@ -439,6 +439,10 @@ local check_for_death = function(self, cause, cmi_cause) and self.animation.die_start and self.animation.die_end then + local frames = self.animation.die_end - self.animation.die_start + local speed = self.animation.die_speed or 15 + local length = max(frames / speed, 0) + self.attack = nil self.v_start = false self.timer = 0 @@ -448,7 +452,7 @@ local check_for_death = function(self, cause, cmi_cause) set_velocity(self, 0) set_animation(self, "die") - minetest.after(2, function(self) + minetest.after(length, function(self) if use_cmi then cmi.notify_die(self.object, cmi_cause) |