1
0
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:
tenplus1
2023-03-13 11:52:59 +00:00
parent 0c2ddab172
commit 7e585b0bdc
2 changed files with 5 additions and 2 deletions

View File

@ -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