mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-25 17:16:02 +00:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user