From fb4fb880e5c4435e0854d7bf4c1e66118425e2e0 Mon Sep 17 00:00:00 2001 From: Dusk-92 Date: Fri, 28 Aug 2026 18:26:15 +0200 Subject: [PATCH] Use Nampower-style player and target GUID path --- src/wow.zig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/wow.zig b/src/wow.zig index 756e15a..fa7b76a 100644 --- a/src/wow.zig +++ b/src/wow.zig @@ -251,8 +251,10 @@ pub fn getPlayerGUID() u64 { } /// Get the local player's object pointer. +/// Use ClntObjMgrGetActivePlayer (0x468550) instead of UnitGUID("player"). +/// This matches the path used by Nampower and does not depend on legacy globals. pub fn getLocalPlayer() u32 { - const guid = unitGUID("player"); + const guid = getPlayerGUID(); if (guid == 0) return 0; return getObjectByGUID(guid); } @@ -337,8 +339,9 @@ pub fn getNameByObject(obj: u32) [*:0]const u8 { } /// Get the current target's GUID. +/// Read the locked target GUID directly (0xB4E2D8), as Nampower does. pub fn getTargetGUID() u64 { - return unitGUID("target"); + return readGUID(o.LOCKED_TARGET_GUID); } /// Check if a unit is friendly to the local player.