Remove gtAirAttack when completely out of visible bounds
authorWuzzy <Wuzzy2@mail.ru>
Thu, 11 Jul 2019 19:58:35 +0200
changeset 15255 186c3f272187
parent 15254 b189d6a2ecda
child 15256 66dcb7728e01
Remove gtAirAttack when completely out of visible bounds
hedgewars/uGearsHandlersMess.pas
--- 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