From 69175e1b19a7502abcbabbed0f7fb8212429bd07 Mon Sep 17 00:00:00 2001 From: Frank Date: Mon, 2 Aug 2021 23:34:42 +0200 Subject: [PATCH] FC --- Moose Development/Moose/Ops/FlightControl.lua | 10 +++++----- Moose Development/Moose/Ops/FlightGroup.lua | 11 +++++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Moose Development/Moose/Ops/FlightControl.lua b/Moose Development/Moose/Ops/FlightControl.lua index 58b7c11ae..b97361749 100644 --- a/Moose Development/Moose/Ops/FlightControl.lua +++ b/Moose Development/Moose/Ops/FlightControl.lua @@ -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 diff --git a/Moose Development/Moose/Ops/FlightGroup.lua b/Moose Development/Moose/Ops/FlightGroup.lua index aeed5a782..f65d1232c 100644 --- a/Moose Development/Moose/Ops/FlightGroup.lua +++ b/Moose Development/Moose/Ops/FlightGroup.lua @@ -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