mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
#1790 Fix for error in GetCustomCallsign if the player name contains a |-sign but no string at the end or just numbers
This commit is contained in:
parent
0731e15385
commit
14c6d1be9b
@ -4074,19 +4074,12 @@ function RANGE:_myname( unitname )
|
|||||||
self:F2( unitname )
|
self:F2( unitname )
|
||||||
local pname = "Ghost 1 1"
|
local pname = "Ghost 1 1"
|
||||||
local unit = UNIT:FindByName( unitname )
|
local unit = UNIT:FindByName( unitname )
|
||||||
if unit then
|
if unit and unit:IsAlive() then
|
||||||
local grp = unit:GetGroup()
|
local grp = unit:GetGroup()
|
||||||
if grp then
|
if grp and grp:IsAlive() then
|
||||||
pname = grp:GetCustomCallSign(true,true)
|
pname = grp:GetCustomCallSign(true,true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--[[
|
|
||||||
local pname = unit:GetPlayerName()
|
|
||||||
-- local csign = unit:GetCallsign()
|
|
||||||
|
|
||||||
-- return string.format("%s (%s)", csign, pname)
|
|
||||||
return string.format( "%s", pname )
|
|
||||||
--]]
|
|
||||||
return pname
|
return pname
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -2766,15 +2766,15 @@ function GROUP:GetCustomCallSign(ShortCallsign,Keepnumber,CallsignTranslations)
|
|||||||
local personalized = false
|
local personalized = false
|
||||||
if IsPlayer and string.find(groupname,"#") then
|
if IsPlayer and string.find(groupname,"#") then
|
||||||
-- personalized flight name in group naming
|
-- personalized flight name in group naming
|
||||||
if Keepnumber then
|
if Keepnumber then
|
||||||
shortcallsign = string.match(groupname,"#(.+)") -- Ghostrider 219
|
shortcallsign = string.match(groupname,"#(.+)") or "Ghost 111" -- Ghostrider 219
|
||||||
else
|
else
|
||||||
shortcallsign = string.match(groupname,"#%s*([%a]+)") -- Ghostrider
|
shortcallsign = string.match(groupname,"#%s*([%a]+)") or "Ghost" -- Ghostrider
|
||||||
end
|
end
|
||||||
personalized = true
|
personalized = true
|
||||||
elseif IsPlayer and string.find(self:GetPlayerName(),"|") then
|
elseif IsPlayer and string.find(self:GetPlayerName(),"|") then
|
||||||
-- personalized flight name in group naming
|
-- 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
|
personalized = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user