Mobs: Also play jump sfx if not moving horizontal
parent
c98df597fc
commit
8b44e6fb7a
|
@ -801,7 +801,7 @@ local do_jump = function(self)
|
||||||
|
|
||||||
-- when in air move forward
|
-- when in air move forward
|
||||||
minetest.after(0.3, function(self, v)
|
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
|
return
|
||||||
end
|
end
|
||||||
self.object:set_acceleration({
|
self.object:set_acceleration({
|
||||||
|
@ -811,12 +811,10 @@ local do_jump = function(self)
|
||||||
})
|
})
|
||||||
end, self, v)
|
end, self, v)
|
||||||
|
|
||||||
if get_velocity(self) > 0 then
|
|
||||||
if self.jump_sound_cooloff <= 0 then
|
if self.jump_sound_cooloff <= 0 then
|
||||||
mob_sound(self, self.sounds.jump)
|
mob_sound(self, self.sounds.jump)
|
||||||
self.jump_sound_cooloff = 0.5
|
self.jump_sound_cooloff = 0.5
|
||||||
end
|
end
|
||||||
end
|
|
||||||
else
|
else
|
||||||
self.facing_fence = true
|
self.facing_fence = true
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue