Fixed an issue with player names cache getting 'Unknown' from UnitName()

This commit is contained in:
Tercio Jose
2024-08-17 17:59:01 -03:00
committed by andrew6180
parent 11a821729b
commit 0897550b1b
5 changed files with 74 additions and 5 deletions
+16 -3
View File
@@ -635,7 +635,7 @@
Details:Msg(Details.WhoAggroTimer.HitBy)
end
local spellInfo = C_Spell.GetSpellInfo(spellId)
--local spellInfo = C_Spell.GetSpellInfo(spellId)
Details222.StartCombat(sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags)
else
--entrar em combate se for dot e for do jogador e o ultimo combate ter sido a mais de 10 segundos atrs
@@ -5585,6 +5585,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
local update_persistant_unitname_cache = function()
Details.UpdatePersistantCacheTimer = nil
local unitIdCache
if (IsInRaid()) then
@@ -5613,7 +5615,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
function Details.parser_functions:GROUP_ROSTER_UPDATE(...)
local bIsInGroup = IsInGroup() or IsInRaid()
update_persistant_unitname_cache()
if (not Details.UpdatePersistantCacheTimer) then
Details.UpdatePersistantCacheTimer = C_Timer.NewTimer(2, update_persistant_unitname_cache)
end
if (not Details.in_group) then
Details.in_group = bIsInGroup
@@ -5817,8 +5821,17 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
end
function Details.parser_functions:UNIT_NAME_UPDATE(...)
function Details.parser_functions:UNIT_NAME_UPDATE(unitId)
Details:SchedulePetUpdate(5)
local unitGUID = UnitGUID(unitId)
if (unitGUID) then
if (unitGUID:match("^Pl")) then
local unitFullName = Details:GetFullName(unitId)
if (unitFullName) then
group_roster_name_cache[unitGUID] = unitFullName
end
end
end
end
function Details.parser_functions:PLAYER_TARGET_CHANGED(...)