mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-07-21 06:04:49 +00:00
#RECOVERYTANKER - Ensure correct "F10 Name" for A6E if used as tanker
This commit is contained in:
@@ -310,7 +310,7 @@ _RECOVERYTANKERID=0
|
||||
|
||||
--- Class version.
|
||||
-- @field #string version
|
||||
RECOVERYTANKER.version="1.0.10"
|
||||
RECOVERYTANKER.version="1.0.11"
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- TODO list
|
||||
@@ -923,6 +923,22 @@ function RECOVERYTANKER:onafterStart(From, Event, To)
|
||||
Spawn:InitRadioCommsOnOff(true)
|
||||
Spawn:InitRadioFrequency(self.RadioFreq)
|
||||
Spawn:InitRadioModulation(self.RadioModu)
|
||||
|
||||
if self.callsignname and self.callsignnumber then
|
||||
local grp = GROUP:FindByName(self.tankergroupname)
|
||||
if grp then
|
||||
local typename = grp:GetTypeName() or ""
|
||||
--self:I(self.lid.."Typename: "..typename)
|
||||
local Name
|
||||
local enumerator = CALLSIGN.Tanker
|
||||
if typename == "A6E" then
|
||||
enumerator = CALLSIGN.Intruder
|
||||
end
|
||||
Name = self:_GetCallsignName(self.callsignname,enumerator)
|
||||
--self:I(self.lid.."CallsignName: "..Name)
|
||||
Spawn:InitCallSign(self.callsignname,Name,self.callsignnumber,self.callsignnumber)
|
||||
end
|
||||
end
|
||||
Spawn:InitModex(self.modex)
|
||||
|
||||
-- Spawn on carrier.
|
||||
@@ -1190,9 +1206,9 @@ function RECOVERYTANKER:onafterPatternUpdate(From, Event, To)
|
||||
-- Task combo.
|
||||
|
||||
-- Be a tanker or be an AWACS.
|
||||
local taskroll = self.tanker:EnRouteTaskTanker()
|
||||
local taskrole = self.tanker:EnRouteTaskTanker()
|
||||
if self.awacs then
|
||||
taskroll=self.tanker:EnRouteTaskAWACS()
|
||||
taskrole=self.tanker:EnRouteTaskAWACS()
|
||||
end
|
||||
|
||||
--local taskeplrs=self.tanker:TaskEPLRS(true, 2)
|
||||
@@ -1201,7 +1217,7 @@ function RECOVERYTANKER:onafterPatternUpdate(From, Event, To)
|
||||
local taskroute = self.tanker:TaskRoute(wp)
|
||||
|
||||
-- Note that the order is important here! tasktanker has to come first. Otherwise it does not work.
|
||||
local taskcombo = self.tanker:TaskCombo({taskroll, taskroute})
|
||||
local taskcombo = self.tanker:TaskCombo({taskrole, taskroute})
|
||||
|
||||
-- Set task.
|
||||
self.tanker:SetTask(taskcombo, 1)
|
||||
@@ -1450,6 +1466,20 @@ function RECOVERYTANKER:_RefuelingStop(EventData)
|
||||
|
||||
end
|
||||
|
||||
--- Get clear name callsign for spawn from enumerator
|
||||
-- @param #RECOVERYTANKER self
|
||||
-- @param #number Callsign
|
||||
-- @param #table Enumerator The table of callsigns, e.g. `CALLSIGN.Tanker`
|
||||
-- @return #string Name Name or "" if not found
|
||||
function RECOVERYTANKER:_GetCallsignName(Callsign, Enumerator)
|
||||
for name, value in pairs(Enumerator or {}) do
|
||||
if value==Callsign then
|
||||
return name
|
||||
end
|
||||
end
|
||||
return ""
|
||||
end
|
||||
|
||||
--- A unit crashed or died.
|
||||
-- @param #RECOVERYTANKER self
|
||||
-- @param Core.Event#EVENTDATA EventData Event data.
|
||||
|
||||
Reference in New Issue
Block a user