Fixed an issue where UnitFullName doesn't return the realm name for units in the same realm as the player, but return the realm if querying the player itself

This commit is contained in:
Tercio Jose
2023-11-10 22:34:29 -03:00
parent 7a5529d4e4
commit daaa3a7f1f
2 changed files with 6 additions and 3 deletions
+2 -2
View File
@@ -13,8 +13,8 @@
local addonName, Details222 = ...
local version, build, date, tocversion = GetBuildInfo()
Details.build_counter = 12031
Details.alpha_build_counter = 12031 --if this is higher than the regular counter, use it instead
Details.build_counter = 12032
Details.alpha_build_counter = 12032 --if this is higher than the regular counter, use it instead
Details.dont_open_news = true
Details.game_version = version
Details.userversion = version .. " " .. Details.build_counter
+4 -1
View File
@@ -210,7 +210,10 @@ do
--UnitFullName is guarantee to return the realm name of the unit queried
local playerName, realmName = UnitFullName(unitId)
if (playerName) then
realmName = realmName:gsub("%s", "")
if (not realmName) then
realmName = GetRealmName()
end
realmName = realmName:gsub("[%s-]", "")
playerName = playerName .. "-" .. realmName