attempt to improve pet detection

This commit is contained in:
Tercio Jose
2022-11-28 17:54:11 -03:00
parent 4b3237f809
commit 5c3f964c84
2 changed files with 33 additions and 11 deletions
+20
View File
@@ -477,6 +477,26 @@
pet_tooltip_frame:SetOwner(WorldFrame, "ANCHOR_NONE")
pet_tooltip_frame:SetHyperlink ("unit:" .. (serial or ""))
local tooltipData = pet_tooltip_frame:GetTooltipData()
if (tooltipData and tooltipData.lines[1]) then
if (tooltipData.lines[1].leftText == nome) then
for i = 2, #tooltipData.lines do
local tooltipLine = tooltipData.lines[i]
local args = tooltipLine.args
if (args) then
if (args[4] and args[4].field == "guid") then
local guidVal = args[4].guidVal
local guidCache = Details:GetParserPlayerCache()
if (guidCache[guidVal]) then
find_pet_found_owner(guidCache[guidVal], serial, nome, flag, self)
return
end
end
end
end
end
end
Details.tabela_vigente.raid_roster_indexed = Details.tabela_vigente.raid_roster_indexed or {}
+13 -11
View File
@@ -6289,8 +6289,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
for i = 1, GetNumGroupMembers() do
local name = GetUnitName("raid"..i, true)
raid_members_cache[UnitGUID("raid"..i)] = true
roster[name] = true
local guid = UnitGUID("raid"..i)
raid_members_cache[guid] = name
roster[name] = guid
local role = _UnitGroupRolesAssigned(name)
if (role == "TANK") then
@@ -6307,24 +6308,25 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
for i = 1, GetNumGroupMembers()-1 do
local name = GetUnitName("party"..i, true)
raid_members_cache[UnitGUID("party"..i)] = true
roster[name] = true
local guid = UnitGUID("party"..i)
raid_members_cache[guid] = name
roster[name] = guid
local role = _UnitGroupRolesAssigned(name)
if (role == "TANK") then
tanks_members_cache[UnitGUID("party"..i)] = true
tanks_members_cache[guid] = true
end
if (auto_regen_power_specs[_detalhes.cached_specs[UnitGUID("party" .. i)]]) then
auto_regen_cache[name] = auto_regen_power_specs[_detalhes.cached_specs[UnitGUID("party" .. i)]]
if (auto_regen_power_specs[_detalhes.cached_specs[guid]]) then
auto_regen_cache[name] = auto_regen_power_specs[_detalhes.cached_specs[guid]]
end
end
--player
local name = GetUnitName("player", true)
raid_members_cache[UnitGUID("player")] = true
roster[name] = true
raid_members_cache[UnitGUID("player")] = name
roster[name] = UnitGUID("player")
local role = _UnitGroupRolesAssigned(name)
if (role == "TANK") then
@@ -6337,8 +6339,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
else
local name = GetUnitName("player", true)
raid_members_cache[UnitGUID("player")] = true
roster[name] = true
raid_members_cache[UnitGUID("player")] = name
roster[name] = UnitGUID("player")
local role = _UnitGroupRolesAssigned(name)
if (role == "TANK") then