mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-07-02 00:10:21 +02:00
add check for 'injured' animation
This commit is contained in:
4
api.lua
4
api.lua
@ -3036,8 +3036,8 @@ 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 and self.animation.run_end then
|
||||
self:set_animation("run")
|
||||
if self.animation and self.animation.injured_end and damage >= 1 then
|
||||
self:set_animation("injured")
|
||||
else
|
||||
self:set_animation("walk")
|
||||
end
|
||||
|
Reference in New Issue
Block a user