This commit is contained in:
Applevangelist 2025-01-18 15:29:35 +01:00
parent 2a1234f7ff
commit 3ed61e8a2a
2 changed files with 11 additions and 3 deletions

View File

@ -3003,7 +3003,7 @@ end
-- local callsign = mygroup:GetCustomCallSign(true,false,nil,function(groupname,playername) return string.match(playername,"([%a]+)$") end)
--
function GROUP:GetCustomCallSign(ShortCallsign,Keepnumber,CallsignTranslations,CustomFunction,...)
--self:I("GetCustomCallSign")
self:T("GetCustomCallSign")
local callsign = "Ghost 1"
if self:IsAlive() then
@ -3016,8 +3016,12 @@ function GROUP:GetCustomCallSign(ShortCallsign,Keepnumber,CallsignTranslations,C
local callnumbermajor = string.char(string.byte(callnumber,1)) -- 9
local callnumberminor = string.char(string.byte(callnumber,2)) -- 1
local personalized = false
local playername = IsPlayer == true and self:GetPlayerName() or shortcallsign
--local playername = IsPlayer == true and self:GetPlayerName() or shortcallsign
local playername = shortcallsign
if IsPlayer then playername = self:GetPlayerName() end
self:T2("GetCustomCallSign outcome = "..playername)
if CustomFunction and IsPlayer then
local arguments = arg or {}
local callsign = CustomFunction(groupname,playername,unpack(arguments))

View File

@ -145,7 +145,11 @@ function POSITIONABLE:GetPosition()
self:F2( self.PositionableName )
local DCSPositionable = self:GetDCSObject()
if self:IsInstanceOf("GROUP") then
DCSPositionable = self:GetFirstUnitAlive():GetDCSObject()
end
if DCSPositionable then
local PositionablePosition = DCSPositionable:getPosition()
self:T3( PositionablePosition )