Some important fixes that improves the routing of the engagements of aircraft. when ground forces move, the aircraft engaging will approach correctly.

also added the squaddrons with resources in the tactical information panel.
and for patrols, now the amount of resources are correctly calculated.
This commit is contained in:
FlightControl
2019-03-04 20:27:40 +01:00
parent 6f13aa2c5b
commit 6fe8667885
5 changed files with 123 additions and 159 deletions

View File

@@ -3351,8 +3351,20 @@ do -- AI_A2G_DISPATCHER
local DefenderSquadron, Patrol = self:CanPatrol( SquadronName, DefenseTaskType )
-- Determine if there are sufficient resources to form a complete group for patrol.
local DefendersNeeded
if DefenderSquadron.ResourceCount == nil then
DefendersNeeded = DefenderSquadron.Grouping
else
if DefenderSquadron.ResourceCount >= DefenderSquadron.Grouping then
DefendersNeeded = DefenderSquadron.Grouping
else
DefendersNeeded = DefenderSquadron.ResourceCount
end
end
if Patrol then
self:ResourceQueue( true, DefenderSquadron, nil, Patrol, DefenseTaskType, nil, SquadronName )
self:ResourceQueue( true, DefenderSquadron, DefendersNeeded, Patrol, DefenseTaskType, nil, SquadronName )
end
end
@@ -3654,7 +3666,7 @@ do -- AI_A2G_DISPATCHER
local x = CheckAttackCoordinate.x
local y = CheckAttackCoordinate.z
local r = 8000
local r = 5000
-- now we check if the coordinate is intersecting with the defense line.
@@ -4098,6 +4110,11 @@ do -- AI_A2G_DISPATCHER
Report:Add( string.format( " - %s - %s", DefenseQueueItem.SquadronName, DefenseQueueItem.DefenderSquadron.TakeoffTime, DefenseQueueItem.DefenderSquadron.TakeoffInterval) )
end
Report:Add( string.format( "\n - Squadron Resources: ", #self.DefenseQueue ) )
for DefenderSquadronName, DefenderSquadron in pairs( self.DefenderSquadrons ) do
Report:Add( string.format( " - %s - %d", DefenderSquadronName, DefenderSquadron.ResourceCount and DefenderSquadron.ResourceCount or "n/a" ) )
end
self:F( Report:Text( "\n" ) )
trigger.action.outText( Report:Text( "\n" ), 25 )