Update AirWing.lua

Avoid loop if mission is governed by an Airwing. Mission cancel will ask airwing to cancel will ask flightgroup to cancel, which doesn't work if the latter is dead. Rare but happens.
This commit is contained in:
Applevangelist 2021-04-04 13:11:25 +02:00 committed by GitHub
parent 05b1ddf013
commit e766eaeccc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1464,7 +1464,9 @@ function AIRWING:onafterMissionCancel(From, Event, To, Mission)
-- Info message.
self:I(self.lid..string.format("Cancel mission %s", Mission.name))
if Mission:IsPlanned() or Mission:IsQueued() or Mission:IsRequested() then
local Ngroups = Mission:CountOpsGroups()
if Mission:IsPlanned() or Mission:IsQueued() or Mission:IsRequested() or Ngroups == 0 then
Mission:Done()