stop rc plane prop/engine sound when out of fuel
authorsheepluva
Thu, 10 Sep 2015 18:50:39 +0200
changeset 11152 3ac7f6d43200
parent 11151 5c40c65b619d
child 11154 1d08386a7c0f
stop rc plane prop/engine sound when out of fuel
hedgewars/uGearsHandlersMess.pas
--- a/hedgewars/uGearsHandlersMess.pas	Thu Sep 10 18:22:52 2015 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Thu Sep 10 18:50:39 2015 +0200
@@ -3677,7 +3677,14 @@
     FollowGear := Gear;
 
     if Gear^.Timer > 0 then
+        begin
+        if Gear^.Timer = 1 then
+            begin
+            StopSoundChan(Gear^.SoundChannel);
+            Gear^.SoundChannel:= -1;
+            end;
         dec(Gear^.Timer);
+        end;
 
     fChanged := false;
     if (HHGear = nil) or ((HHGear^.State and gstHHDriven) = 0) or (Gear^.Timer = 0) then