hedgewars/GSHandlers.inc
changeset 9072 e7bcdf4f492f
parent 9059 426aae3ffccd
child 9073 6cffcbef02e4
--- a/hedgewars/GSHandlers.inc	Tue May 28 14:09:19 2013 -0400
+++ b/hedgewars/GSHandlers.inc	Tue May 28 21:30:02 2013 -0400
@@ -5092,9 +5092,16 @@
     end;
     if Gear^.Message and (gmUp or gmDown) <> 0 then
         begin
+        StopSoundChan(Gear^.SoundChannel);
+        Gear^.SoundChannel:= -1;
         if GameTicks mod 40 = 0 then dec(Gear^.Health)
         end
-    else if GameTicks mod 10 = 0 then dec(Gear^.Health);
+    else 
+        begin
+        if Gear^.SoundChannel = -1 then
+            Gear^.SoundChannel := LoopSound(sndIceBeam);
+        if GameTicks mod 10 = 0 then dec(Gear^.Health)
+        end
 end;
 
 
@@ -5135,6 +5142,7 @@
     HHGear := Gear^.Hedgehog^.Gear;
     if (Gear^.Message and gmAttack <> 0) or (Gear^.Health = 0) or (HHGear = nil) or (HHGear^.Damage <> 0) then
         begin
+        StopSoundChan(Gear^.SoundChannel);
         DeleteGear(Gear);
         AfterAttack;
         exit