This commit is contained in:
Frank 2021-08-02 23:34:42 +02:00
parent a5ad58e516
commit 69175e1b19
2 changed files with 12 additions and 9 deletions

View File

@ -590,7 +590,7 @@ function FLIGHTCONTROL:_CheckQueues()
-- Give AI the landing signal.
-- TODO: Humans have to confirm via F10 menu.
if flight.ai then
if flight.isAI then
self:_LandAI(flight, parking)
end
@ -612,7 +612,7 @@ function FLIGHTCONTROL:_CheckQueues()
if ntakeoff==0 and nlanding==0 then
-- Check if flight is AI. Humans have to request taxi via F10 menu.
if flight.ai then
if flight.isAI then
---
-- AI
@ -822,7 +822,7 @@ function FLIGHTCONTROL:_GetNextFightParking()
-- Get the first AI flight.
for i,_flight in pairs(Qparking) do
local flight=_flight --Ops.FlightGroup#FLIGHTGROUP
if flight.ai then
if flight.isAI then
return flight
end
end
@ -851,7 +851,7 @@ function FLIGHTCONTROL:_PrintQueue(queue, name)
-- Gather info.
local fuel=flight.group:GetFuelMin()*100
local ai=tostring(flight.ai)
local ai=tostring(flight.isAI)
local actype=tostring(flight.actype)
-- Holding and parking time.
@ -916,7 +916,7 @@ function FLIGHTCONTROL:_RemoveFlightFromQueue(queue, flight, queuename)
self:I(self.lid..string.format("Removing flight group %s from %s queue.", flight.groupname, queuename))
table.remove(queue, i)
if not flight.ai then
if not flight.isAI then
flight:_UpdateMenu()
end

View File

@ -902,11 +902,14 @@ function FLIGHTGROUP:onafterStatus(From, Event, To)
local nTaskTot, nTaskSched, nTaskWP=self:CountRemainingTasks()
local nMissions=self:CountRemainingMissison()
local home=self.homebase and self.homebase:GetName() or "unknown"
local dest=self.destbase and self.destbase:GetName() or "unknown"
local fc=self.flightcontrol and self.flightcontrol.airbasename or "N/A"
local curr=self.currbase and self.currbase:GetName() or "N/A"
local text=string.format("Status %s [%d/%d]: Tasks=%d (%d,%d) Curr=%d, Missions=%s, Waypoint=%d/%d, Detected=%d, Home=%s, Destination=%s",
fsmstate, #self.elements, #self.elements, nTaskTot, nTaskSched, nTaskWP, self.taskcurrent, nMissions, self.currentwp or 0, self.waypoints and #self.waypoints or 0,
self.detectedunits:Count(), self.homebase and self.homebase:GetName() or "unknown", self.destbase and self.destbase:GetName() or "unknown")
local text=string.format("Status %s [%d/%d]: Tasks=%d, Missions=%s, Waypoint=%d/%d, Detected=%d, Home=%s, Destination=%s, Current=%s, FC=%s",
fsmstate, #self.elements, #self.elements, nTaskTot, nMissions, self.currentwp or 0, self.waypoints and #self.waypoints or 0,
self.detectedunits:Count(), home, dest, curr, fc)
self:I(self.lid..text)
end