hedgewars/uGearsHandlersMess.pas
changeset 14006 1670fc3957df
parent 14005 817dc8b67b0d
child 14015 996ef4c5d064
--- a/hedgewars/uGearsHandlersMess.pas	Fri Oct 26 15:52:07 2018 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Fri Oct 26 15:55:48 2018 +0200
@@ -5593,6 +5593,7 @@
     HHGear := Gear^.Hedgehog^.Gear;
     if HHGear = nil then
         begin
+        StopSoundChan(gear^.SoundChannel);
         DeleteGear(gear);
         exit
         end;
@@ -5639,6 +5640,7 @@
         begin
         HHGear^.Message:= HHGear^.Message and (not gmAttack);
         HHGear^.State := HHGear^.State and (not gstNotKickable);
+        StopSoundChan(gear^.SoundChannel);
         DeleteGear(Gear);
         AfterAttack
         end
@@ -5662,6 +5664,7 @@
     HHGear := Gear^.Hedgehog^.Gear;
     HHGear^.Message := HHGear^.Message and (not (gmUp or gmDown or gmLeft or gmRight or gmAttack));
     HHGear^.State := HHGear^.State or gstNotKickable;
+    Gear^.SoundChannel := LoopSound(sndLandGun);
     Gear^.doStep := @doStepLandGunWork
 end;