This commit is contained in:
Frank
2020-08-25 17:55:53 +02:00
parent 3f39ec0ae0
commit 06600b2a94
4 changed files with 227 additions and 169 deletions

View File

@@ -1591,10 +1591,9 @@ function AIRWING:onafterAssetSpawned(From, Event, To, group, asset, request)
-- Get the SQUADRON of the asset.
local squadron=self:GetSquadronOfAsset(asset)
-- Set default TACAN channel.
-- Get TACAN channel.
local Tacan=squadron:FetchTacan()
if Tacan then
flightgroup:SwitchTACAN(Tacan, Morse, UnitName, Band)
asset.tacan=Tacan
end
@@ -1617,14 +1616,27 @@ function AIRWING:onafterAssetSpawned(From, Event, To, group, asset, request)
-- Add mission to flightgroup queue.
if mission then
if Tacan then
mission:SetTACAN(Tacan, Morse, UnitName, Band)
end
-- Add mission to flightgroup queue.
asset.flightgroup:AddMission(mission)
-- Trigger event.
self:FlightOnMission(flightgroup, mission)
else
if Tacan then
flightgroup:SwitchTACAN(Tacan, Morse, UnitName, Band)
end
end
-- Add group to the detection set of the WINGCOMMANDER.
if self.wingcommander and self.wingcommander.chief then
self.wingcommander.chief.detectionset:AddGroup(asset.flightgroup.group)