mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2024-12-25 02:00:21 +01:00
add animation nil check
This commit is contained in:
parent
59fe1dd976
commit
733672127c
4
api.lua
4
api.lua
@ -25,7 +25,7 @@ local use_cmi = minetest.global_exists("cmi")
|
|||||||
|
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20230304",
|
version = "20230311",
|
||||||
intllib = S,
|
intllib = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {}
|
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
|
-- turn mob on knockback and play run/walk animation
|
||||||
self:set_yaw((random(0, 360) - 180) / 180 * pi, 12)
|
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")
|
self:set_animation("run")
|
||||||
else
|
else
|
||||||
self:set_animation("walk")
|
self:set_animation("walk")
|
||||||
|
Loading…
Reference in New Issue
Block a user