hedgewars/GSHandlers.inc
changeset 3136 326a8cb7d9b7
parent 3123 b0a02930a1dc
child 3139 a075f5344796
--- a/hedgewars/GSHandlers.inc	Sun Mar 28 12:02:51 2010 +0000
+++ b/hedgewars/GSHandlers.inc	Sun Mar 28 16:35:44 2010 +0000
@@ -236,9 +236,10 @@
 else
     Gear^.State:= Gear^.State or      gstMoving;
 
-if ((Gear^.Damage <> 0) or ((Gear^.State and (gstCollision or gstMoving)) = (gstCollision or gstMoving))) and
-   ((Gear^.dX.QWordValue > _0_1.QWordValue) or (Gear^.dY.QWordValue > _0_1.QWordValue)) then
-   PlaySound(Gear^.ImpactSound);
+if (Gear^.nImpactSounds > 0) then
+    if ((Gear^.Damage <> 0) or ((Gear^.State and (gstCollision or gstMoving)) = (gstCollision or gstMoving))) and
+       ((Gear^.dX.QWordValue > _0_1.QWordValue) or (Gear^.dY.QWordValue > _0_1.QWordValue)) then
+        PlaySound(TSound(ord(Gear^.ImpactSound) + GetRandom(Gear^.nImpactSounds)));
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -318,19 +319,11 @@
 
 if Gear^.Kind = gtHellishBomb then
     begin
-    if (Gear^.Timer > 3000) and ((Gear^.State and (gstCollision or gstMoving)) = (gstCollision or gstMoving)) and
-       ((Gear^.dX.QWordValue > _0_1.QWordValue) or (Gear^.dY.QWordValue > _0_1.QWordValue)) then
-        case random(4) of
-            0: Gear^.ImpactSound:= sndHellishImpact1;
-            1: Gear^.ImpactSound:= sndHellishImpact2;
-            2: Gear^.ImpactSound:= sndHellishImpact3;
-            3: Gear^.ImpactSound:= sndHellishImpact4
-        end;
 
     if Gear^.Timer = 3000 then
         begin
+        Gear^.nImpactSounds:= 0;
         PlaySound(sndHellish);
-        Gear^.ImpactSound:= sndNone
         end;
 
     if (GameTicks and $3F) = 0 then