mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
commit
4747dae51a
@ -1659,3 +1659,36 @@ function UNIT:GetSkill()
|
||||
local skill = _DATABASE.Templates.Units[name].Template.skill or "Random"
|
||||
return skill
|
||||
end
|
||||
|
||||
--- Get Link16 STN or SADL TN and other datalink info from Unit, if any.
|
||||
-- @param #UNIT self
|
||||
-- @return #string STN STN or TN Octal as string, or nil if not set/capable.
|
||||
-- @return #string VCL Voice Callsign Label or nil if not set/capable.
|
||||
-- @return #string VCN Voice Callsign Number or nil if not set/capable.
|
||||
-- @return #string Lead If true, unit is Flight Lead, else false or nil.
|
||||
function UNIT:GetSTN()
|
||||
self:F2(self.UnitName)
|
||||
local STN = nil -- STN/TN
|
||||
local VCL = nil -- VoiceCallsignLabel
|
||||
local VCN = nil -- VoiceCallsignNumber
|
||||
local FGL = false -- FlightGroupLeader
|
||||
local template = self:GetTemplate()
|
||||
if template.AddPropAircraft then
|
||||
if template.AddPropAircraft.STN_L16 then
|
||||
STN = template.AddPropAircraft.STN_L16
|
||||
elseif template.AddPropAircraft.SADL_TN then
|
||||
STN = template.AddPropAircraft.SADL_TN
|
||||
end
|
||||
VCN = template.AddPropAircraft.VoiceCallsignNumber
|
||||
VCL = template.AddPropAircraft.VoiceCallsignLabel
|
||||
end
|
||||
if template.datalinks and template.datalinks.Link16 and template.datalinks.Link16.settings then
|
||||
FGL = template.datalinks.Link16.settings.flightLead
|
||||
end
|
||||
-- A10CII
|
||||
if template.datalinks and template.datalinks.SADL and template.datalinks.SADL.settings then
|
||||
FGL = template.datalinks.SADL.settings.flightLead
|
||||
end
|
||||
|
||||
return STN, VCL, VCN, FGL
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user