GROUP/UNIT - added :GetNatoReportingName()

This commit is contained in:
Applevangelist
2022-04-23 16:41:47 +02:00
parent 4c7ac68858
commit 2f4d5b32b6
3 changed files with 31 additions and 1 deletions

View File

@@ -900,6 +900,24 @@ function GROUP:GetTypeName()
return nil
end
--- [AIRPLANE] Get the NATO reporting name of a UNIT. Currently airplanes only!
--@param #UNIT self
--@return #string NatoReportingName or "Bogey" if unknown.
function GROUP:GetNatoReportingName()
self:F2( self.GroupName )
local DCSGroup = self:GetDCSObject()
if DCSGroup then
local GroupTypeName = DCSGroup:getUnit(1):getTypeName()
self:T3( GroupTypeName )
return UTILS.GetReportingName(GroupTypeName)
end
return "Bogey"
end
--- Gets the player name of the group.
-- @param #GROUP self
-- @return #string The player name of the group.