From 072936655471b2dc5eec17c864e900ec620796e7 Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Fri, 15 May 2026 02:09:12 -0500 Subject: [PATCH] null crash --- src/player/NameCache.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/player/NameCache.cpp b/src/player/NameCache.cpp index cb4e0896..9b17daac 100644 --- a/src/player/NameCache.cpp +++ b/src/player/NameCache.cpp @@ -494,6 +494,17 @@ int __fastcall ScanCallback(void * /*context*/, void * /*edx*/, uint64_t guid) { } void ScanVisibleObjects() { + // The iterator's prologue is `mov eax, [VAR_LOCAL_PLAYER_PTR]` + + // unconditional `mov ebx, [eax+0xAC]` — at the glue / character- + // select screen the global is NULL and the engine crashes on the + // deref. Gate the call ourselves rather than relying on other + // DLLs' hooks to catch it; we've seen VanillaMinimapTracking's + // guard not fire when ClassicAPI and VMT are both loaded and our + // path through `FrameRegisterEvent_h → Tick → MaybeScan` reaches + // the iterator during glue Lua script load. + if (*reinterpret_cast( + static_cast(Offsets::VAR_LOCAL_PLAYER_PTR)) == nullptr) + return; auto enumerate = reinterpret_cast( static_cast(Offsets::FUN_CLNT_OBJ_MGR_ENUM_VISIBLE_OBJECTS)); enumerate(reinterpret_cast(&ScanCallback), nullptr);