mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 08:00:42 +00:00
refactor(object): gate on Object::RegistryReady instead of the raw pointer
Six sites tested [VAR_LOCAL_PLAYER_PTR] for null inline to mean "the world is up": loot/Scan, loot/Unit, loot/UnitItem, target/Nearest, the totem tracker, and the inline-texture glue check (whose comment already defines glue as "no local player"). Object::RegistryReady is that exact test, named; they now call it. The remaining reads of the global use its value (SoftTarget's manager identity, Identity's player GUID), not a null test.
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "frame/RegionDestruction.h"
|
||||
#include "text/PtrProbe.h"
|
||||
#include "tick/FrameTick.h"
|
||||
#include "object/Resolve.h"
|
||||
|
||||
#include <windows.h> // SEH (__try/__except, EXCEPTION_EXECUTE_HANDLER)
|
||||
|
||||
@@ -125,8 +126,7 @@ uint32_t FsColorKey(const void *fs) {
|
||||
uint32_t FadedColor(const Placement &p, uint32_t fsColor) {
|
||||
const uint32_t a = ((p.color >> 24) * (fsColor >> 24)) / 0xFFu;
|
||||
uint32_t rgb = p.color & 0x00FFFFFFu;
|
||||
const bool inGlue =
|
||||
*reinterpret_cast<void *volatile *>(Offsets::VAR_LOCAL_PLAYER_PTR) == nullptr;
|
||||
const bool inGlue = !Object::RegistryReady();
|
||||
if (inGlue) {
|
||||
const uint32_t b = fsColor & 0xFFu, g = (fsColor >> 8) & 0xFFu,
|
||||
r = (fsColor >> 16) & 0xFFu;
|
||||
|
||||
Reference in New Issue
Block a user