improved sound change event

This commit is contained in:
Alexsandro Percy 2022-02-03 18:07:40 -03:00
parent b87fb84f89
commit 6b3d8b9642
2 changed files with 4 additions and 4 deletions

View File

@ -57,10 +57,10 @@ end
function buggy.engine_set_sound_and_animation(self, _longit_speed)
--minetest.chat_send_all('test1 ' .. dump(self._engine_running) )
if self.sound_handle then
--if (math.abs(self._longit_speed) > math.abs(_longit_speed) + 0.08) or (math.abs(self._longit_speed) + 0.08 < math.abs(_longit_speed)) then
if (math.abs(self._longit_speed) > math.abs(_longit_speed) + 0.08) or (math.abs(self._longit_speed) + 0.08 < math.abs(_longit_speed)) then
--minetest.chat_send_all('test2')
buggy.engineSoundPlay(self)
--end
end
end
end

View File

@ -55,10 +55,10 @@ end
function roadster.engine_set_sound_and_animation(self, _longit_speed)
--minetest.chat_send_all('test1 ' .. dump(self._engine_running) )
if self.sound_handle then
--if (math.abs(self._longit_speed) > math.abs(_longit_speed) + 0.08) or (math.abs(self._longit_speed) + 0.08 < math.abs(_longit_speed)) then
if (math.abs(self._longit_speed) > math.abs(_longit_speed) + 0.08) or (math.abs(self._longit_speed) + 0.08 < math.abs(_longit_speed)) then
--minetest.chat_send_all('test2')
roadster.engineSoundPlay(self)
--end
end
end
end