tracking: PlayerIsDruidInCatForm via GetShapeshiftFormID

The byte-2-of-UNIT_BYTES_1 extraction this function did manually
(math.floor(b/65536) - math.floor(b/16777216)*256 on the GetUnitField
return) is precisely what GetShapeshiftFormID reads under the hood —
descriptor +0x212. Collapses to a one-liner that doesn't need to
mirror the engine's byte layout in Lua.
This commit is contained in:
Brues
2026-05-21 17:30:34 -05:00
parent 11f9cd848b
commit 00a3e2f691
+1 -8
View File
@@ -200,14 +200,7 @@ pfUI:RegisterModule("tracking", "vanilla", function ()
end
function pfUI.tracking:PlayerIsDruidInCatForm(playerClass)
if playerClass == "DRUID" then
local b = GetUnitField("player", "bytes1")
if b then
local form = math.floor(b / 65536) - math.floor(b / 16777216) * 256
return form == 1 -- 1 = Cat Form
end
end
return false
return playerClass == "DRUID" and GetShapeshiftFormID() == 1
end
function pfUI.tracking:InitMenu()