- Improved holding point
This commit is contained in:
Frank
2022-05-12 21:19:55 +02:00
parent d58d04d6a0
commit 97a4b79713
3 changed files with 120 additions and 39 deletions

View File

@@ -713,8 +713,17 @@ function FLIGHTGROUP:ClearToLand(Delay)
else
if self:IsHolding() then
-- Set flag.
self:T(self.lid..string.format("Clear to land ==> setting holding flag to 1 (true)"))
self.flaghold:Set(1)
-- Clear holding stack.
if self.stack then
self.stack.flightgroup=nil
self.stack=nil
end
end
end
@@ -2536,12 +2545,16 @@ function FLIGHTGROUP:_LandAtAirbase(airbase, SpeedTo, SpeedHold, SpeedLand)
-- Do we have a flight control?
local fc=_DATABASE:GetFlightControl(airbase:GetName())
if fc then
-- Get holding point from flight control.
local HoldingPoint=fc:_GetHoldingpoint(self)
if HoldingPoint then
if HoldingPoint then
HoldingPoint.flightgroup=self
self.stack=HoldingPoint
-- Race track points.
p0=HoldingPoint.pos0
@@ -2553,6 +2566,8 @@ function FLIGHTGROUP:_LandAtAirbase(airbase, SpeedTo, SpeedHold, SpeedLand)
p1:MarkToAll(string.format("%s: Holding point P1, alt=%d meters", self:GetName(), p0.y))
end
else
end
-- Set flightcontrol for this flight.
@@ -2809,6 +2824,7 @@ function FLIGHTGROUP:onafterHolding(From, Event, To)
-- Holding time stamp.
self.Tholding=timer.getAbsTime()
-- Debug message.
local text=string.format("Flight group %s is HOLDING now", self.groupname)
self:T(self.lid..text)