diff --git a/api.lua b/api.lua index 250944a..ab35e26 100644 --- a/api.lua +++ b/api.lua @@ -28,7 +28,7 @@ local use_cmi = minetest.global_exists("cmi") mobs = { mod = "redo", - version = "20220430", + version = "20220501", intllib = S, invis = minetest.global_exists("invisibility") and invisibility or {} } @@ -2389,11 +2389,22 @@ function mob_class:do_states(dtime) else self:set_velocity(self.walk_velocity) + -- figure out which animation to use while in motion if self:flight_check() and self.animation and self.animation.fly_start and self.animation.fly_end then - self:set_animation("fly") + + local on_ground = minetest.registered_nodes[self.standing_on].walkable + local in_water = minetest.registered_nodes[self.standing_in].groups.water + + if on_ground and in_water then + self:set_animation("fly") + elseif on_ground then + self:set_animation("walk") + else + self:set_animation("fly") + end else self:set_animation("walk") end