Commit acd217f5 authored by Robin Schoonover's avatar Robin Schoonover

Also set pet species ID for wild pets.

parent 1b204fd2
......@@ -18,10 +18,16 @@ end)
--
--
local tmpSetUnit = {}
function handleUnit(tip, unitType, ...)
if unitType == "Creature" or unitType == "Pet" or unitType == "GameObject" or unitType == "Vehicle" then
if unitType == "Creature" or unitType == "Pet" or unitType == "Vehicle" then
local _, _, _, _, id = ...
addon:AddIDLine(tip, unitType, id)
tinsert(tmpSetUnit, "NPC")
tinsert(tmpSetUnit, id)
elseif unitType == "GameObject" then
local _, _, _, _, id = ...
tinsert(tmpSetUnit, "Object")
tinsert(tmpSetUnit, id)
end
end
......@@ -31,12 +37,23 @@ addon:HookTipScript("OnTooltipSetUnit", function(self)
return
end
wipe(tmpSetUnit)
local guid = UnitGUID(unit)
if guid then
handleUnit(self, strsplit("-", guid))
else
-- TODO check for battle pet
end
if UnitIsWildBattlePet(unit) then
local speciesID = UnitBattlePetSpeciesID(unit)
if speciesID then
tinsert(tmpSetUnit, "Species")
tinsert(tmpSetUnit, speciesID)
end
end
if #tmpSetUnit > 0 then
addon:AddIDLine(self, unpack(tmpSetUnit))
end
end)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment