hedgewars/uGearsHandlersMess.pas
changeset 15478 20066da10268
parent 15474 1e3761ecfc13
child 15514 6ddfde71ba6a
--- a/hedgewars/uGearsHandlersMess.pas	Fri Oct 11 22:28:08 2019 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Sat Oct 12 02:06:11 2019 +0200
@@ -2348,6 +2348,13 @@
     doStepFallingGear(Gear);
     AllInactive := false;
 
+    if (Gear^.SoundChannel <> -1) and ((Gear^.State and gstDrowning) <> 0) then
+        begin
+        StopSoundChan(Gear^.SoundChannel);
+        Gear^.SoundChannel:= -1;
+        end
+    else if Gear^.SoundChannel = -1 then
+        Gear^.SoundChannel := LoopSound(sndDynamiteFuse);
     if (Gear^.State and gstDrowning) <> 0 then
         exit;
     if Gear^.Timer mod 166 = 0 then
@@ -2356,6 +2363,7 @@
         makeHogsWorry(Gear^.X, Gear^.Y, 75, Gear^.Kind);
     if Gear^.Timer = 0 then
         begin
+        StopSoundChan(Gear^.SoundChannel);
         doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), Gear^.Boom, Gear^.Hedgehog, EXPLAutoSound);
         DeleteGear(Gear);
         exit