From 733672127c9c55a5421023f83df9dc4b40b39b1a Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Fri, 10 Mar 2023 08:09:15 +0000 Subject: [PATCH] add animation nil check --- api.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api.lua b/api.lua index 5b909af..3eeef26 100644 --- a/api.lua +++ b/api.lua @@ -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")