From 5aabd836f97b23e8a97ff3f0aafa1317d5f6c214 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sat, 31 Oct 2026 00:42:10 +0000 Subject: [PATCH] Decompile fn_23504 (CSession::InitNpcLocationRadius) Batch #6340 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_23504 CSession::InitNpcLocationRadius: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, KWDev, SapitoSucio Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Client/Session.h | 1 + Source/Contents/NpcLocationRadius.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/Source/Client/Session.h b/Source/Client/Session.h index cf97e3cca..f366c0c85 100644 --- a/Source/Client/Session.h +++ b/Source/Client/Session.h @@ -701,6 +701,7 @@ public: const ActionFrame* GetSyncedFrame(CActRes* baseAct, CActRes* act, unsigned action, int baseFrame, std::uint32_t startTime, int* frame); float GetNpcLocationRadius(int job, bool riding); int GetRidingJob(int job); + void InitNpcLocationRadius(); int GetSpriteJob(int job, int costumeJob, bool spriteIndex); bool HasRequiredItems() const; bool IsSlotItemIdentity(std::uint32_t id) const; diff --git a/Source/Contents/NpcLocationRadius.cpp b/Source/Contents/NpcLocationRadius.cpp index 7c24d7c30..d8f02076a 100644 --- a/Source/Contents/NpcLocationRadius.cpp +++ b/Source/Contents/NpcLocationRadius.cpp @@ -436,3 +436,15 @@ int CSession::GetRidingJob(int job) { return job; } + +// OFFSET: 0x00DF31C0 +// FUNCTION: fn_23504 +void CSession::InitNpcLocationRadius() { + this->m_npcLocationRadius.clear(); + for (int job = 0; job < 32003; ++job) { + double factor = 0.0; + if (this->m_hotkeyScript->Call("ReqshadowFactor", "d>l", job, &factor) && factor >= 0.0) { + this->m_npcLocationRadius.try_emplace(job, static_cast(factor)); + } + } +}