From 8b44e6fb7a913d44ed733168a0ec10dc4a182b29 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 9 Mar 2019 00:24:53 +0100 Subject: [PATCH] Mobs: Also play jump sfx if not moving horizontal --- mods/ENTITIES/mcl_mobs/api.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index e331cf72b7..003ca49587 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -801,7 +801,7 @@ local do_jump = function(self) -- when in air move forward minetest.after(0.3, function(self, v) - if not self.object:get_luaentity() then + if not self.object or not self.object:get_luaentity() then return end self.object:set_acceleration({ @@ -811,11 +811,9 @@ local do_jump = function(self) }) end, self, v) - if get_velocity(self) > 0 then - if self.jump_sound_cooloff <= 0 then - mob_sound(self, self.sounds.jump) - self.jump_sound_cooloff = 0.5 - end + if self.jump_sound_cooloff <= 0 then + mob_sound(self, self.sounds.jump) + self.jump_sound_cooloff = 0.5 end else self.facing_fence = true