From 7a5529d4e4a606949d3cafb71dcea992e7f6c5c0 Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Fri, 10 Nov 2023 21:10:01 -0300 Subject: [PATCH] More fixes --- boot.lua | 4 ++-- core/parser.lua | 12 ++++++++---- functions/classes.lua | 14 ++++++++------ 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/boot.lua b/boot.lua index 3a521172..ab63e19e 100644 --- a/boot.lua +++ b/boot.lua @@ -13,8 +13,8 @@ local addonName, Details222 = ... local version, build, date, tocversion = GetBuildInfo() - Details.build_counter = 12030 - Details.alpha_build_counter = 12030 --if this is higher than the regular counter, use it instead + Details.build_counter = 12031 + Details.alpha_build_counter = 12031 --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 diff --git a/core/parser.lua b/core/parser.lua index abc1cd43..5e077f65 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -7125,11 +7125,15 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 Details.pvp_parser_frame.ticker = nil end - local _player, realmName = UnitFullName('player') - function Details.pvp_parser_frame:ReadPvPData() local players = GetNumBattlefieldScores() + local _player, realmName = UnitFullName("player") + if (not realmName) then + realmName = GetRealmName() + realmName = realmName:gsub("%s+", "") + end + for i = 1, players do local name, killingBlows, honorableKills, deaths, honorGained, faction, race, rank, class, classToken, damageDone, healingDone, bgRating, ratingChange, preMatchMMR, mmrChange, talentSpec if (isWOTLK) then @@ -7139,8 +7143,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end if (not isWOTLK and not isERA) then --Must be dragonflight - if (not name:match('%-')) then - name = name .. '-' .. realmName + if (not name:match("%-")) then + name = name .. "-" .. realmName end end diff --git a/functions/classes.lua b/functions/classes.lua index 728673fa..1ba51867 100644 --- a/functions/classes.lua +++ b/functions/classes.lua @@ -209,15 +209,17 @@ do function Details:GetFullName(unitId, ambiguateString) --UnitFullName is guarantee to return the realm name of the unit queried local playerName, realmName = UnitFullName(unitId) - realmName = realmName:gsub("%s", "") + if (playerName) then + realmName = realmName:gsub("%s", "") - playerName = playerName .. "-" .. realmName + playerName = playerName .. "-" .. realmName - if (ambiguateString) then - playerName = Ambiguate(playerName, ambiguateString) + if (ambiguateString) then + playerName = Ambiguate(playerName, ambiguateString) + end + + return playerName end - - return playerName end if (toc < 100200) then