Changing player detection by GUID

This commit is contained in:
Tercio Jose
2024-08-30 11:44:00 -03:00
committed by andrew6180
parent fe8b3536d1
commit defce45d74
3 changed files with 12 additions and 3 deletions
+6 -1
View File
@@ -371,8 +371,10 @@ local packActorSerial = function(actor)
local npcId = GetCreatureIDFromGUID(serial) or 0
return "C" .. npcId
elseif (GUIDIsPlayer(serial) == 0) then
elseif (GUIDIsPlayer(serial)) then
return "P"
elseif (GUIDIsPet(serial)) then
return "Pe"
end
end
@@ -382,6 +384,9 @@ local unpackActorSerial = function(serialNumber)
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
return Details.packfunctions.CreateNPCGUID(0, 0, serialNumber:gsub("C", ""), Details.packFunctions.GenerateSerialNumber())
end