mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
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:
@@ -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 )
|
||||
|
||||
Reference in New Issue
Block a user