- Improved behaviour when mission is unpaused and groups are teleported
This commit is contained in:
Frank 2025-06-10 21:58:19 +02:00
parent 95767c5ef4
commit 2a9a7db9b8
3 changed files with 10 additions and 2 deletions

View File

@ -1403,6 +1403,8 @@ function AUFTRAG:NewINTERCEPT(Target)
end
--- **[AIR]** Create a CAP mission.
-- Assinged groups are tasked to execute a CAP mission. This consists of a DCS orbit task combined with an enroute "search and engage in zone" task.
-- **Note** that currently DCS only supports *circular* zones for the task.
-- @param #AUFTRAG self
-- @param Core.Zone#ZONE_RADIUS ZoneCAP Circular CAP zone. Detected targets in this zone will be engaged.
-- @param #number Altitude Altitude at which to orbit in feet. Default is 10,000 ft.

View File

@ -2002,6 +2002,9 @@ function FLIGHTGROUP:onafterElementAirborne(From, Event, To, Element)
-- Debug info.
self:T2(self.lid..string.format("Element airborne %s", Element.name))
-- Set parking spot to free. Also for FC. This is usually done after taxiing but doing it here in case the group is teleported.
self:_SetElementParkingFree(Element)
-- Set element status.
self:_UpdateStatus(Element, OPSGROUP.ElementStatus.AIRBORNE)

View File

@ -5589,10 +5589,13 @@ function OPSGROUP:onafterUnpauseMission(From, Event, To)
-- Debug info.
self:T(self.lid..string.format("Unpausing mission %s [%s]", mission:GetName(), mission:GetType()))
-- Set state of mission, e.g. for not teleporting again
mission.unpaused=true
-- Start mission.
self:MissionStart(mission)
-- Remove mission from
-- Remove mission from pausedmissions queue
for i,mid in pairs(self.pausedmissions) do
--self:T(self.lid..string.format("Checking paused mission", mid))
if mid==mission.auftragsnummer then
@ -6232,7 +6235,7 @@ function OPSGROUP:RouteToMission(mission, delay)
end
-- Check if group is mobile. Note that some immobile units report a speed of 1 m/s = 3.6 km/h.
if self.speedMax<=3.6 or mission.teleport then
if (self.speedMax<=3.6 or mission.teleport) and not mission.unpaused then
-- Teleport to waypoint coordinate. Mission will not be paused.
self:Teleport(waypointcoord, nil, true)