From a3d77e56321db66ab4ed66b389a7232a9edfedf5 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 29 Oct 2026 21:06:57 +0000 Subject: [PATCH] Decompile 2 functions in Source/Contents/NavigationRequest.cpp, Source/Contents/NavigationManager.h Batch #3191 by ragnarok-clanker: 0 byte-identical, 2 confirmed by peer review. - fn_19420 FindNaviObjectByName: logic confirmed by peer review - fn_19470 CNaviInfo::FindMobByName: logic confirmed by peer review Peer-reviewed-by: eAthena, meitogi Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/NavigationManager.h | 3 +++ Source/Contents/NavigationRequest.cpp | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/Source/Contents/NavigationManager.h b/Source/Contents/NavigationManager.h index 1d8ba3ad..ba3939ef 100644 --- a/Source/Contents/NavigationManager.h +++ b/Source/Contents/NavigationManager.h @@ -163,6 +163,8 @@ struct NaviObjectRecord { }; #pragma pack(pop) +CNavi_Object* FindNaviObjectByName(const char* name, const std::vector& objects); + class CNaviInfo { public: CNaviInfo(int index, const char* name, const char* title, int cellX, int cellY, int type); @@ -184,6 +186,7 @@ public: CNavi_Link* FindLink(unsigned int key, bool byId); CNavi_Object* FindNpc(unsigned int key, bool byId); CNavi_Object* FindNpcAt(int cellX, int cellY); + CNavi_Object* FindMobByName(const char* name); std::vector* Npcs(); int LinkCount() const; int MobCount() const; diff --git a/Source/Contents/NavigationRequest.cpp b/Source/Contents/NavigationRequest.cpp index d4a68bd9..285e78ae 100644 --- a/Source/Contents/NavigationRequest.cpp +++ b/Source/Contents/NavigationRequest.cpp @@ -9,6 +9,17 @@ #include #include +// OFFSET: 0x00B8C0B0 +// FUNCTION: fn_19420 +__declspec(noinline) CNavi_Object* FindNaviObjectByName(const char* name, const std::vector& objects) { + for (CNavi_Object* object : objects) { + if (name && std::string(name) == object->name) { + return object; + } + } + return nullptr; +} + // OFFSET: 0x00B8DF10 // FUNCTION: fn_19461 std::uint16_t CNavi_Object::GetFlag() const { @@ -540,3 +551,9 @@ void CNaviInfo::SearchNpcs(const std::vector& keywords, std::vector out.push_back(target); } } + +// OFFSET: 0x00B8E410 +// FUNCTION: fn_19470 +CNavi_Object* CNaviInfo::FindMobByName(const char* name) { + return FindNaviObjectByName(name, this->mobs); +}