hedgewars/uGearsHandlersMess.pas
changeset 15234 186c3f272187
parent 15233 b189d6a2ecda
child 15235 66dcb7728e01
--- a/hedgewars/uGearsHandlersMess.pas	Thu Jul 11 19:14:54 2019 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Thu Jul 11 19:58:35 2019 +0200
@@ -3127,7 +3127,7 @@
 
     // Get rid of gear and cleanup
     if ((WorldEdge = weWrap) and (Gear^.FlightTime >= 4000)) or
-        ((WorldEdge <> weWrap) and ((hwRound(Gear^.X) > (max(LAND_WIDTH,4096)+2048)) or (hwRound(Gear^.X) < -2048) or ((Gear^.Message and gmDestroy) > 0))) then
+        ((WorldEdge <> weWrap) and (((hwRound(Gear^.X) - Gear^.Radius > (max(LAND_WIDTH,4096)+2048)) or (hwRound(Gear^.X) + Gear^.Radius < -2048) or ((Gear^.Message and gmDestroy) > 0))) then
         begin
         // fail-safe: instanly stop sound if it wasn't disabled before
         if (Gear^.SoundChannel <> -1) then