mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-06-28 06:30:18 +02:00
use api functions for riding mob
This commit is contained in:
@ -344,7 +344,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
|
||||
if entity.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
|
||||
|
||||
if stand_anim then
|
||||
mobs:set_animation(entity, stand_anim)
|
||||
entity:set_animation(stand_anim)
|
||||
end
|
||||
|
||||
return
|
||||
@ -352,7 +352,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
|
||||
|
||||
-- set moving animation
|
||||
if moving_anim then
|
||||
mobs:set_animation(entity, moving_anim)
|
||||
entity:set_animation(moving_anim)
|
||||
end
|
||||
|
||||
-- Stop!
|
||||
@ -518,9 +518,9 @@ function mobs.fly(entity, _, speed, shoots, arrow, moving_anim, stand_anim)
|
||||
|
||||
-- change animation if stopped
|
||||
if velo.x == 0 and velo.y == 0 and velo.z == 0 then
|
||||
mobs:set_animation(entity, stand_anim)
|
||||
entity:set_animation(stand_anim)
|
||||
else
|
||||
-- moving animation
|
||||
mobs:set_animation(entity, moving_anim)
|
||||
entity:set_animation(moving_anim)
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user