hedgewars/uGearsUtils.pas
changeset 8989 ae97ab6dcc70
parent 8987 47cf32305d99
child 8990 e64a1a851b69
--- a/hedgewars/uGearsUtils.pas	Mon May 13 22:58:40 2013 -0400
+++ b/hedgewars/uGearsUtils.pas	Tue May 14 06:33:59 2013 -0400
@@ -408,7 +408,7 @@
                             exit // skip splashes 
                 end;
             if ((not isSubmersible) and (Y < cWaterLine + 64 + Gear^.Radius))
-            or (isSubmersible and (Y < cWaterLine + 2 + Gear^.Radius) and ((CurAmmoGear^.Pos = 0)
+            or (isSubmersible and (Y < cWaterLine + 2 + Gear^.Radius) and (Gear = CurAmmoGear) and ((CurAmmoGear^.Pos = 0)
             and (CurAmmoGear^.dY < _0_01))) then
                 if Gear^.Density * Gear^.dY > _1 then
                     PlaySound(sndSplash)
@@ -420,7 +420,7 @@
 
         if ((cReducedQuality and rqPlainSplash) = 0)
         and (((not isSubmersible) and (Y < cWaterLine + 64 + Gear^.Radius))
-        or (isSubmersible and (Y < cWaterLine + 2 + Gear^.Radius) and ((CurAmmoGear^.Pos = 0)
+        or (isSubmersible and (Y < cWaterLine + 2 + Gear^.Radius) and (Gear = CurAmmoGear) and ((CurAmmoGear^.Pos = 0)
         and (CurAmmoGear^.dY < _0_01)))) then
             begin
             splash:= AddVisualGear(X, cWaterLine, vgtSplash);
@@ -461,7 +461,7 @@
                         end
                 end
             end;
-        if isSubmersible and (CurAmmoGear^.Pos = 0) then
+        if isSubmersible and (Gear = CurAmmoGear) and (CurAmmoGear^.Pos = 0) then
             CurAmmoGear^.Pos := 1000
         end
     else