FLIGHTGROUP

- Increased dealy before Route to base to 1.0 sec. Previous delay of 0.1 sec was apparently too short for the stop flag to take effect and the task was not called done. Hence the mission was also not done.
This commit is contained in:
Frank 2023-01-07 17:04:34 +01:00
parent 584e932769
commit ab272da46e
4 changed files with 20 additions and 21 deletions

View File

@ -1001,8 +1001,8 @@ do -- Unit
--- Enum that stores aircraft refueling system types.
-- @type Unit.RefuelingSystem
-- @field BOOM_AND_RECEPTACLE
-- @field PROBE_AND_DROGUE
-- @field BOOM_AND_RECEPTACLE Tanker with a boom.
-- @field PROBE_AND_DROGUE Tanker with a probe.
--- Enum that stores sensor types.
-- @type Unit.SensorType

View File

@ -216,7 +216,7 @@ FLIGHTGROUP.Players={}
--- FLIGHTGROUP class version.
-- @field #string version
FLIGHTGROUP.version="0.8.3"
FLIGHTGROUP.version="0.8.4"
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- TODO list
@ -2637,20 +2637,9 @@ function FLIGHTGROUP:onafterRTB(From, Event, To, airbase, SpeedTo, SpeedHold, Sp
-- Set the destination base.
self.destbase=airbase
-- Cancel all missions.
for _,_mission in pairs(self.missionqueue) do
local mission=_mission --Ops.Auftrag#AUFTRAG
local mystatus=mission:GetGroupStatus(self)
-- Check if mission is already over!
if not (mystatus==AUFTRAG.GroupStatus.DONE or mystatus==AUFTRAG.GroupStatus.CANCELLED) then
local text=string.format("Canceling mission %s in state=%s", mission.name, mission.status)
self:T(self.lid..text)
self:MissionCancel(mission)
end
end
self:CancelAllMissions()
-- Land at airbase.
self:_LandAtAirbase(airbase, SpeedTo, SpeedHold, SpeedLand)
@ -2895,8 +2884,11 @@ function FLIGHTGROUP:_LandAtAirbase(airbase, SpeedTo, SpeedHold, SpeedLand)
--self:ClearTasks()
-- Just route the group. Respawn might happen when going from holding to final.
-- NOTE: I have delayed that here because of RTB calling _LandAtAirbase which resets current task immediately. So the stop flag change to 1 will not trigger TaskDone() and a current mission is not done either
self:Route(wp, 0.1)
-- NOTE: I have delayed that here because of RTB calling _LandAtAirbase which resets current task immediately.
-- So the stop flag change to 1 will not trigger TaskDone() and a current mission is not done either!
-- Looks like a delay of 0.1 sec was not enough for the stopflag to take effect. Increasing this to 1.0 sec.
-- This delay is looking better. Hopefully not any unwanted side effects in other situations.
self:Route(wp, 1.0)
end

View File

@ -1068,7 +1068,8 @@ function LEGION:onafterMissionRequest(From, Event, To, Mission, Assets)
--self:AddRequest(self, WAREHOUSE.Descriptor.ASSETLIST, Assetlist, #Assetlist, nil, nil, Mission.prio, assignment)
local request=self:_AddRequest(WAREHOUSE.Descriptor.ASSETLIST, Assetlist, #Assetlist, Mission.prio, assignment)
env.info(string.format("FF Added request=%d for Nasssets=%d", request.uid, #Assetlist))
-- Debug Info.
self:T(self.lid..string.format("Added request=%d for Nasssets=%d", request.uid, #Assetlist))
-- The queueid has been increased in the onafterAddRequest function. So we can simply use it here.
--Mission.requestID[self.alias]=self.queueid

View File

@ -4898,7 +4898,7 @@ function OPSGROUP:RemoveMission(Mission)
return self
end
--- Cancel all missions in mission queue.
--- Cancel all missions in mission queue that are not already done or cancelled.
-- @param #OPSGROUP self
function OPSGROUP:CancelAllMissions()
self:T(self.lid.."Cancelling ALL missions!")
@ -4906,7 +4906,13 @@ function OPSGROUP:CancelAllMissions()
-- Cancel all missions.
for _,_mission in pairs(self.missionqueue) do
local mission=_mission --Ops.Auftrag#AUFTRAG
if mission:IsNotOver() then
-- Current group status.
local mystatus=mission:GetGroupStatus(self)
-- Check if mission is already over!
if not (mystatus==AUFTRAG.GroupStatus.DONE or mystatus==AUFTRAG.GroupStatus.CANCELLED) then
--if mission:IsNotOver() then
self:T(self.lid.."Cancelling mission "..tostring(mission:GetName()))
self:MissionCancel(mission)
end