mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-01-24 16:20:19 +01:00
use api functions for riding mob
This commit is contained in:
parent
71e620eb0f
commit
768ef84bd8
2
api.lua
2
api.lua
@ -3493,7 +3493,7 @@ function mob_class:on_step(dtime, moveresult)
|
||||
|
||||
self.pause_timer = self.pause_timer - dtime
|
||||
|
||||
if self.pause_timer <= 0 and self.order == "stand" then
|
||||
if self.pause_timer < 0 and self.order == "stand" then
|
||||
|
||||
self.pause_timer = 0
|
||||
self:set_velocity(0)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user