From 768ef84bd88736d965c659b8b33620e4f90e350e Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Fri, 13 Oct 2023 08:31:55 +0100 Subject: [PATCH] use api functions for riding mob --- api.lua | 2 +- mount.lua | 8 ++++---- readme.MD | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api.lua b/api.lua index 8ec1ce9..a0c04c0 100644 --- a/api.lua +++ b/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) diff --git a/mount.lua b/mount.lua index af2e084..fc44e0b 100644 --- a/mount.lua +++ b/mount.lua @@ -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 diff --git a/readme.MD b/readme.MD index d33a28e..899e7ef 100644 --- a/readme.MD +++ b/readme.MD @@ -106,7 +106,7 @@ https://forum.minetest.net/viewtopic.php?f=11&t=9917 ### Version 1.48 -* Added `mobs:set_velocity(self, velocity)` global function +* Added `mobs:set_velocity(self, velocity)` global function [deprecated] ### Version 1.47