Changing player detection by GUID
This commit is contained in:
@@ -5124,6 +5124,10 @@ function _G.__benchmark(bNotPrintResult)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function DF:DebugTexture(texture, left, right, top, bottom)
|
||||||
|
return DF:PreviewTexture(texture, left, right, top, bottom)
|
||||||
|
end
|
||||||
|
|
||||||
function DF:PreviewTexture(texture, left, right, top, bottom)
|
function DF:PreviewTexture(texture, left, right, top, bottom)
|
||||||
if (texture and type(texture) == "table" and texture.GetObjectType and texture:GetObjectType() == "Texture") then
|
if (texture and type(texture) == "table" and texture.GetObjectType and texture:GetObjectType() == "Texture") then
|
||||||
DF:Msg("PreviewTexture: you have passed a texture object (uiobject) instead of the texture atlas, filename or id.")
|
DF:Msg("PreviewTexture: you have passed a texture object (uiobject) instead of the texture atlas, filename or id.")
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ function Details222.Pets.AkaarisSoulOwner(petGUID)
|
|||||||
do
|
do
|
||||||
local ownerGUID = tooltipData.guid --tooltipData.guid seems to exists on all akari soul tooltips and point to the owner guid
|
local ownerGUID = tooltipData.guid --tooltipData.guid seems to exists on all akari soul tooltips and point to the owner guid
|
||||||
if (ownerGUID) then
|
if (ownerGUID) then
|
||||||
if (ownerGUID:find("^P")) then
|
if (ownerGUID:find("^Pl")) then
|
||||||
local playerGUID = ownerGUID
|
local playerGUID = ownerGUID
|
||||||
local actorObject = Details:GetActorFromCache(playerGUID) --quick cache only exists during conbat
|
local actorObject = Details:GetActorFromCache(playerGUID) --quick cache only exists during conbat
|
||||||
if (actorObject) then
|
if (actorObject) then
|
||||||
@@ -105,7 +105,7 @@ function Details222.Pets.AkaarisSoulOwner(petGUID)
|
|||||||
local lineData = tooltipData.lines[i]
|
local lineData = tooltipData.lines[i]
|
||||||
if (lineData.unitToken) then --unit token seems to exists when the add belongs to the "player"
|
if (lineData.unitToken) then --unit token seems to exists when the add belongs to the "player"
|
||||||
local ownerGUID = UnitGUID(lineData.unitToken)
|
local ownerGUID = UnitGUID(lineData.unitToken)
|
||||||
if (ownerGUID and ownerGUID:find("^P")) then
|
if (ownerGUID and ownerGUID:find("^Pl")) then
|
||||||
local playerGUID = ownerGUID
|
local playerGUID = ownerGUID
|
||||||
local actorObject = Details:GetActorFromCache(playerGUID) --quick cache only exists during conbat
|
local actorObject = Details:GetActorFromCache(playerGUID) --quick cache only exists during conbat
|
||||||
if (actorObject) then
|
if (actorObject) then
|
||||||
|
|||||||
+6
-1
@@ -371,8 +371,10 @@ local packActorSerial = function(actor)
|
|||||||
local npcId = GetCreatureIDFromGUID(serial) or 0
|
local npcId = GetCreatureIDFromGUID(serial) or 0
|
||||||
return "C" .. npcId
|
return "C" .. npcId
|
||||||
|
|
||||||
elseif (GUIDIsPlayer(serial) == 0) then
|
elseif (GUIDIsPlayer(serial)) then
|
||||||
return "P"
|
return "P"
|
||||||
|
elseif (GUIDIsPet(serial)) then
|
||||||
|
return "Pe"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -382,6 +384,9 @@ local unpackActorSerial = function(serialNumber)
|
|||||||
|
|
||||||
return Details.packfunctions.CreatePlayerGUID(0, 0, 0, Details.packFunctions.GenerateSerialNumber())
|
return Details.packfunctions.CreatePlayerGUID(0, 0, 0, Details.packFunctions.GenerateSerialNumber())
|
||||||
|
|
||||||
|
elseif (serialNumber:match("^Pe")) then
|
||||||
|
return Details.packfunctions.CreatePetGUID(0, serialNumber:gsub("Pe", ""), Details.packFunctions.GenerateSerialNumber())
|
||||||
|
|
||||||
elseif (serialNumber:match("^C")) then
|
elseif (serialNumber:match("^C")) then
|
||||||
return Details.packfunctions.CreateNPCGUID(0, 0, serialNumber:gsub("C", ""), Details.packFunctions.GenerateSerialNumber())
|
return Details.packfunctions.CreateNPCGUID(0, 0, serialNumber:gsub("C", ""), Details.packFunctions.GenerateSerialNumber())
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user