diff --git a/Moose Development/Moose/Functional/Range.lua b/Moose Development/Moose/Functional/Range.lua index 4388d2cba..35697c148 100644 --- a/Moose Development/Moose/Functional/Range.lua +++ b/Moose Development/Moose/Functional/Range.lua @@ -4074,19 +4074,12 @@ function RANGE:_myname( unitname ) self:F2( unitname ) local pname = "Ghost 1 1" local unit = UNIT:FindByName( unitname ) - if unit then + if unit and unit:IsAlive() then local grp = unit:GetGroup() - if grp then + if grp and grp:IsAlive() then pname = grp:GetCustomCallSign(true,true) end end - --[[ - local pname = unit:GetPlayerName() - -- local csign = unit:GetCallsign() - - -- return string.format("%s (%s)", csign, pname) - return string.format( "%s", pname ) - --]] return pname end diff --git a/Moose Development/Moose/Wrapper/Group.lua b/Moose Development/Moose/Wrapper/Group.lua index c12292433..e8e2e6fb9 100644 --- a/Moose Development/Moose/Wrapper/Group.lua +++ b/Moose Development/Moose/Wrapper/Group.lua @@ -2766,15 +2766,15 @@ function GROUP:GetCustomCallSign(ShortCallsign,Keepnumber,CallsignTranslations) local personalized = false if IsPlayer and string.find(groupname,"#") then -- personalized flight name in group naming - if Keepnumber then - shortcallsign = string.match(groupname,"#(.+)") -- Ghostrider 219 - else - shortcallsign = string.match(groupname,"#%s*([%a]+)") -- Ghostrider - end + if Keepnumber then + shortcallsign = string.match(groupname,"#(.+)") or "Ghost 111" -- Ghostrider 219 + else + shortcallsign = string.match(groupname,"#%s*([%a]+)") or "Ghost" -- Ghostrider + end personalized = true elseif IsPlayer and string.find(self:GetPlayerName(),"|") then -- personalized flight name in group naming - shortcallsign = string.match(self:GetPlayerName(),"|%s*([%a]+)") -- Ghostrider + shortcallsign = string.match(self:GetPlayerName(),"|%s*([%a]+)") or string.match(self:GetPlayerName(),"|%s*([%d]+)") or "Ghost" -- Ghostrider personalized = true end