# HG changeset patch # User Wuzzy # Date 1562869422 -7200 # Node ID 66dcb7728e0125f5fc017e590d6aae12b888aa81 # Parent 186c3f272187127e1d70a9315858f0df1b60b916 Air attack: Fix infintie sound when target is at extreme X pos diff -r 186c3f272187 -r 66dcb7728e01 hedgewars/uGearsHandlersMess.pas --- a/hedgewars/uGearsHandlersMess.pas Thu Jul 11 19:58:35 2019 +0200 +++ b/hedgewars/uGearsHandlersMess.pas Thu Jul 11 20:23:42 2019 +0200 @@ -3108,16 +3108,17 @@ if CheckCoordInWater(hwRound(Gear^.X), hwRound(Gear^.Y)) then FollowGear^.State:= FollowGear^.State or gstSubmersible; - if (Gear^.SoundChannel <> -1) and (WorldEdge <> weSea) then - begin - StopSoundChan(Gear^.SoundChannel, 4000); - Gear^.SoundChannel := -1; - end; end; if (Gear^.Health = 0) then inc(Gear^.FlightTime); + if (Gear^.SoundChannel <> -1) and (WorldEdge <> weSea) and (Gear^.FlightTime > 20) then + begin + StopSoundChan(Gear^.SoundChannel, 4000); + Gear^.SoundChannel := -1; + end; + // Particles if (GameTicks and $3F) = 0 then if CheckCoordInWater(hwRound(Gear^.X), hwRound(Gear^.Y)) then @@ -3127,7 +3128,7 @@ // Get rid of gear and cleanup if ((WorldEdge = weWrap) and (Gear^.FlightTime >= 4000)) or - ((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 + ((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