mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Update FlightGroup.lua
Avoid endless when plane/heli is not airborne by needs to RTB
This commit is contained in:
parent
220e004d73
commit
31b93fb42c
@ -147,6 +147,7 @@ FLIGHTGROUP = {
|
||||
Tparking = nil,
|
||||
menu = nil,
|
||||
ishelo = nil,
|
||||
RTBRecallCount = 0,
|
||||
}
|
||||
|
||||
|
||||
@ -2150,11 +2151,16 @@ function FLIGHTGROUP:onbeforeRTB(From, Event, To, airbase, SpeedTo, SpeedHold)
|
||||
end
|
||||
|
||||
if not self.group:IsAirborne(true) then
|
||||
self:I(self.lid..string.format("WARNING: Group is not AIRBORNE ==> RTB event is suspended for 10 sec."))
|
||||
-- this should really not happen, either the AUFTRAG is cancelled before the group was airborne or it is stuck at the ground for some reason
|
||||
self:I(self.lid..string.format("WARNING: Group is not AIRBORNE ==> RTB event is suspended for 20 sec."))
|
||||
allowed=false
|
||||
Tsuspend=-10
|
||||
Tsuspend=-20
|
||||
self.RTBRecallCount = self.RTBRecallCount+1
|
||||
if self.RTBRecallCount > 3 then
|
||||
self:Despawn(5)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- Only if fuel is not low or critical.
|
||||
if not (self:IsFuelLow() or self:IsFuelCritical()) then
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user