Fix double water splash if flying saucer drowns (bug 681)
authorWuzzy <Wuzzy2@mail.ru>
Thu, 10 Jan 2019 00:33:05 +0100
changeset 14555 c38dd843763f
parent 14554 1b97bc7de936
child 14556 65780bd056c1
Fix double water splash if flying saucer drowns (bug #681)
hedgewars/uGearsUtils.pas
--- a/hedgewars/uGearsUtils.pas	Wed Jan 09 22:19:46 2019 +0100
+++ b/hedgewars/uGearsUtils.pas	Thu Jan 10 00:33:05 2019 +0100
@@ -757,7 +757,7 @@
                 end
             else // submersible
                 begin
-                // drown submersible grears if far below map
+                // drown submersible gears if far below map
                 if (Y > cWaterLine + cVisibleWater*4) then
                     begin
                     DrownGear(Gear);
@@ -796,7 +796,8 @@
 
         // splash sound animation and droplets
         if isImpact or isSkip then
-            addSplashForGear(Gear, isSkip);
+            if (not (((dist2Water + Gear^.Radius div 2) < 0) or (abs(dist2Water + Gear^.Radius) >= Gear^.Radius))) then
+                addSplashForGear(Gear, isSkip);
 
         if isSkip then
             ScriptCall('onGearWaterSkip', Gear^.uid);