1
0
mirror of https://codeberg.org/tenplus1/mobs_redo.git synced 2024-11-14 06:20:18 +01:00

add animation nil check

This commit is contained in:
tenplus1 2023-03-10 08:09:15 +00:00
parent 59fe1dd976
commit 733672127c

View File

@ -25,7 +25,7 @@ local use_cmi = minetest.global_exists("cmi")
mobs = {
mod = "redo",
version = "20230304",
version = "20230311",
intllib = S,
invis = minetest.global_exists("invisibility") and invisibility or {}
}
@ -3018,7 +3018,7 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir, damage)
-- turn mob on knockback and play run/walk animation
self:set_yaw((random(0, 360) - 180) / 180 * pi, 12)
if self.animation.run_end then
if self.animation and self.animation.run_end then
self:set_animation("run")
else
self:set_animation("walk")