hedgewars/GSHandlers.inc
changeset 4956 48e1f9a04c28
parent 4886 e3e5362a308e
child 4966 fa612a614317
--- a/hedgewars/GSHandlers.inc	Fri Feb 25 16:32:24 2011 -0500
+++ b/hedgewars/GSHandlers.inc	Sat Feb 26 15:56:11 2011 +0100
@@ -2307,13 +2307,19 @@
             //4: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtWaterMelon, 0, cBombsSpeed *
             //                 Gear^.Tag, _0, 5000);
         end;
-        Gear^.dX := Gear^.dX + int2hwFloat(30 * Gear^.Tag)
+        Gear^.dX := Gear^.dX + int2hwFloat(30 * Gear^.Tag);
+        StopSound(Gear^.SoundChannel, 4000);
     end;
 
     if (GameTicks and $3F) = 0 then
         AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace);
 
-    if (hwRound(Gear^.X) > (LAND_WIDTH+1024)) or (hwRound(Gear^.X) < -1024) then DeleteGear(Gear)
+    if (hwRound(Gear^.X) > (LAND_WIDTH+1024)) or (hwRound(Gear^.X) < -1024) then
+    begin
+        // avoid to play forever (is this necessary?)
+        StopSound(Gear^.SoundChannel);
+        DeleteGear(Gear)
+    end;
 end;
 
 procedure doStepAirAttack(Gear: PGear);
@@ -2344,6 +2350,8 @@
 
     Gear^.Health := 6;
     Gear^.doStep := @doStepAirAttackWork;
+    Gear^.SoundChannel := LoopSound(sndPlane, 4000);
+
 end;
 
 ////////////////////////////////////////////////////////////////////////////////