From 00a3e2f691d5798293c540f7adff1a9d3e3d6221 Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Thu, 21 May 2026 17:30:34 -0500 Subject: [PATCH] tracking: PlayerIsDruidInCatForm via GetShapeshiftFormID MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- modules/tracking.lua | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/modules/tracking.lua b/modules/tracking.lua index 97b73b1f..e9608b85 100644 --- a/modules/tracking.lua +++ b/modules/tracking.lua @@ -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()