WIP: V32 POLISH32 temporary build #2
+18
-10
@@ -213,23 +213,27 @@ pub fn scanObjects() void {
|
|||||||
if (wow.isInGame()) debug_in_world_seen = true;
|
if (wow.isInGame()) debug_in_world_seen = true;
|
||||||
if (wow.hasObjectManager()) debug_object_manager_seen = true;
|
if (wow.hasObjectManager()) debug_object_manager_seen = true;
|
||||||
|
|
||||||
// Resolve the local player through the engine API instead of the legacy
|
// Diagnose player GUID and object resolution separately. The local player
|
||||||
// OBJECT_MANAGER_PTR global. This is also how Nampower resolves objects.
|
// is useful for occlusion/dead-friendly tracking, but it is NOT required
|
||||||
const local_player = wow.getLocalPlayer();
|
// for outlining the current target. Never abort target tracking just
|
||||||
if (local_player == 0) return;
|
// because the player object cannot be resolved.
|
||||||
|
const player_guid = wow.getPlayerGUID();
|
||||||
|
if (player_guid != 0) debug_player_guid_seen = true;
|
||||||
|
|
||||||
|
const local_player = if (player_guid != 0) wow.getObjectByGUID(player_guid) else 0;
|
||||||
|
if (local_player != 0) {
|
||||||
debug_local_player_seen = true;
|
debug_local_player_seen = true;
|
||||||
|
|
||||||
// Local player renders before outline targets (occludes outlines) unless
|
// Local player renders before outline targets (occludes outlines) unless
|
||||||
// the local player IS an outline target (partition logic checks outline first).
|
// the local player IS an outline target.
|
||||||
if (game_obj_ptr_count < MAX_TRACKED_OBJS) {
|
if (game_obj_ptr_count < MAX_TRACKED_OBJS) {
|
||||||
game_obj_ptrs[game_obj_ptr_count] = local_player;
|
game_obj_ptrs[game_obj_ptr_count] = local_player;
|
||||||
game_obj_ptr_count += 1;
|
game_obj_ptr_count += 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Cache raid target GUIDs
|
// Resolve the selected target independently of local-player resolution.
|
||||||
wow.cacheRaidTargets();
|
// This must run even when player/object-manager legacy paths are unavailable.
|
||||||
|
|
||||||
// Resolve target to object pointer (highest priority - added first)
|
|
||||||
const target_guid = wow.getTargetGUID();
|
const target_guid = wow.getTargetGUID();
|
||||||
if (target_guid != 0) {
|
if (target_guid != 0) {
|
||||||
debug_target_guid_seen = true;
|
debug_target_guid_seen = true;
|
||||||
@@ -240,6 +244,9 @@ pub fn scanObjects() void {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Cache raid target GUIDs for optional secondary outline categories.
|
||||||
|
wow.cacheRaidTargets();
|
||||||
|
|
||||||
// Iterate all visible objects only when the legacy object-manager global
|
// Iterate all visible objects only when the legacy object-manager global
|
||||||
// is available. Target outlining above does not depend on this traversal.
|
// is available. Target outlining above does not depend on this traversal.
|
||||||
var obj: u32 = 0;
|
var obj: u32 = 0;
|
||||||
@@ -254,7 +261,7 @@ pub fn scanObjects() void {
|
|||||||
|
|
||||||
switch (obj_type) {
|
switch (obj_type) {
|
||||||
.player => {
|
.player => {
|
||||||
if (wow.isUnitDead(obj) and wow.isUnitFriendly(obj, local_player)) {
|
if (local_player != 0 and wow.isUnitDead(obj) and wow.isUnitFriendly(obj, local_player)) {
|
||||||
addTrackedObj(obj, .dead_player, 0);
|
addTrackedObj(obj, .dead_player, 0);
|
||||||
}
|
}
|
||||||
const mark = wow.getRaidMarkForGUID(guid);
|
const mark = wow.getRaidMarkForGUID(guid);
|
||||||
@@ -334,6 +341,7 @@ pub var diag: Diag = .{};
|
|||||||
// stage has been observed and stay true for the whole process lifetime.
|
// stage has been observed and stay true for the whole process lifetime.
|
||||||
pub var debug_in_world_seen: bool = false;
|
pub var debug_in_world_seen: bool = false;
|
||||||
pub var debug_object_manager_seen: bool = false;
|
pub var debug_object_manager_seen: bool = false;
|
||||||
|
pub var debug_player_guid_seen: bool = false;
|
||||||
pub var debug_local_player_seen: bool = false;
|
pub var debug_local_player_seen: bool = false;
|
||||||
pub var debug_target_guid_seen: bool = false;
|
pub var debug_target_guid_seen: bool = false;
|
||||||
pub var debug_target_object_seen: bool = false;
|
pub var debug_target_object_seen: bool = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user