From 6b3d8b9642d5051abb75aff2da29e2477428afcf Mon Sep 17 00:00:00 2001 From: Alexsandro Percy Date: Thu, 3 Feb 2022 18:07:40 -0300 Subject: [PATCH] improved sound change event --- automobiles_buggy/buggy_utilities.lua | 4 ++-- automobiles_roadster/roadster_utilities.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/automobiles_buggy/buggy_utilities.lua b/automobiles_buggy/buggy_utilities.lua index 4066795..16c139b 100755 --- a/automobiles_buggy/buggy_utilities.lua +++ b/automobiles_buggy/buggy_utilities.lua @@ -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 diff --git a/automobiles_roadster/roadster_utilities.lua b/automobiles_roadster/roadster_utilities.lua index ff4ab29..a5991a7 100755 --- a/automobiles_roadster/roadster_utilities.lua +++ b/automobiles_roadster/roadster_utilities.lua @@ -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