mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Fixes to resolve exceptions in multi player situations
This commit is contained in:
@@ -1724,14 +1724,16 @@ do -- AI_A2A_DISPATCHER
|
||||
self:E( { DefenderSquadron } )
|
||||
local SpawnCoord = DefenderSquadron.Airbase:GetCoordinate() -- Core.Point#COORDINATE
|
||||
local TargetCoord = Target.Set:GetFirst():GetCoordinate()
|
||||
local Distance = SpawnCoord:Get2DDistance( TargetCoord )
|
||||
|
||||
if ClosestDistance == 0 or Distance < ClosestDistance then
|
||||
if TargetCoord then
|
||||
local Distance = SpawnCoord:Get2DDistance( TargetCoord )
|
||||
|
||||
-- Only intercept if the distance to target is smaller or equal to the GciRadius limit.
|
||||
if Distance <= self.GciRadius then
|
||||
ClosestDistance = Distance
|
||||
ClosestDefenderSquadronName = SquadronName
|
||||
if ClosestDistance == 0 or Distance < ClosestDistance then
|
||||
|
||||
-- Only intercept if the distance to target is smaller or equal to the GciRadius limit.
|
||||
if Distance <= self.GciRadius then
|
||||
ClosestDistance = Distance
|
||||
ClosestDefenderSquadronName = SquadronName
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user