- Fixed bug task for recoverytanker mission
- Improved capturezone auftrag
This commit is contained in:
Frank 2022-12-31 12:35:48 +01:00
parent 3834991e6a
commit 9a949c02c5
4 changed files with 23 additions and 6 deletions

View File

@ -726,7 +726,7 @@ function ARMYGROUP:Status()
local mission=self:GetMissionCurrent()
-- If mission, check if DCS task needs to be updated.
if mission and mission.updateDCSTask and mission:GetGroupStatus(self)==AUFTRAG.GroupStatus.EXECUTING then
if mission and mission.updateDCSTask then
if mission.type==AUFTRAG.Type.CAPTUREZONE then
@ -734,7 +734,9 @@ function ARMYGROUP:Status()
local Task=mission:GetGroupWaypointTask(self)
-- Update task: Engage or get new zone.
self:_UpdateTask(Task, mission)
if mission:GetGroupStatus(self)==AUFTRAG.GroupStatus.EXECUTING or mission:GetGroupStatus(self)==AUFTRAG.GroupStatus.STARTED then
self:_UpdateTask(Task, mission)
end
end

View File

@ -943,7 +943,7 @@ function FLIGHTGROUP:Status()
local DCSTask=mission:GetDCSMissionTask() --DCS#Task
-- Get task.
local Task=self:GetTaskByID(mission.auftragsnummer)
local Task=mission:GetGroupWaypointTask(self)
-- Reset current orbit task.
self.controller:resetTask()

View File

@ -4438,8 +4438,8 @@ function OPSGROUP:_UpdateTask(Task, Mission)
self:EngageTarget(targetgroup)
else
-- Error Message.
self:E(self.lid..string.format("ERROR: Current zone not captured but no target group could be found. This should NOT happen!"))
-- Debug info.
self:T(self.lid..string.format("Zone %s not captured but no target group could be found. Should be captured in the next zone evaluation.", zoneCurr:GetName()))
end
else

View File

@ -1041,6 +1041,10 @@ function OPSZONE:Scan()
-- Add unit to set.
self.ScanUnitSet:AddUnit(unit)
-- Debug: Had cases where a (red) unit was clearly not inside the zone but the scan did find it!
--local inzone=unit:IsInZone(self.zone)
--unit:GetCoordinate():MarkToAll(string.format("Unit %s inzone=%s", unit:GetName(), tostring(inzone)))
-- Get group of unit.
local group=unit:GetGroup()
@ -1120,7 +1124,18 @@ function OPSZONE:Scan()
-- Debug info.
if self.verbose>=3 then
local text=string.format("Scan result Nred=%d, Nblue=%d, Nneutral=%d", Nred, Nblu, Nnut)
local text=string.format("Scan result Nred=%d, Nblue=%d, Nneutral=%d", Nred, Nblu, Nnut)
if self.verbose>=4 then
for _,_unit in pairs(self.ScanUnitSet:GetSet()) do
local unit=_unit --Wrapper.Unit#UNIT
text=text..string.format("\nUnit %s coalition=%s", unit:GetName(), unit:GetCoalitionName())
end
for _,_group in pairs(self.ScanGroupSet:GetSet()) do
local group=_group --Wrapper.Group#GROUP
text=text..string.format("\nGroup %s coalition=%s", group:GetName(), group:GetCoalitionName())
end
end
self:I(self.lid..text)
end