From 840c168e23892f87d5aff59bd8a13b5226c35bd7 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 29 Oct 2026 09:56:08 +0000 Subject: [PATCH] Decompile 2 functions in Source/Contents/NavigationSource.cpp, Source/Contents/NavigationManager.h Batch #2076 by ragnarok-clanker: 0 byte-identical, 2 confirmed by peer review. - fn_19554 NavigationTarget::NavigationTarget: logic confirmed by peer review - fn_19566 CNavigationManager::ReadObject: logic confirmed by peer review Reviewed-by: ragnarok-clanker --- Source/Contents/NavigationManager.h | 2 + Source/Contents/NavigationSource.cpp | 56 ++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/Source/Contents/NavigationManager.h b/Source/Contents/NavigationManager.h index acb310e2..c131f63c 100644 --- a/Source/Contents/NavigationManager.h +++ b/Source/Contents/NavigationManager.h @@ -202,6 +202,7 @@ public: struct NavigationTarget { NavigationTarget() : type(-1), object(nullptr), x(-1), y(-1) {} + NavigationTarget(int type, void* object); // INLINED NavigationTarget(int type, void* object, int x, int y, std::string name) { @@ -288,6 +289,7 @@ public: NaviCell ParseCell(const char* text); std::vector WriteTarget(NavigationTarget target); std::vector WriteObject(CNavi_Object* object); + CNavi_Link* ReadObject(const char* record); void ClearSavedTarget(); void ClearCurrentObject(); void ClearStates(); diff --git a/Source/Contents/NavigationSource.cpp b/Source/Contents/NavigationSource.cpp index 1b289783..fe2ff825 100644 --- a/Source/Contents/NavigationSource.cpp +++ b/Source/Contents/NavigationSource.cpp @@ -461,6 +461,62 @@ std::vector CNavigationManager::WriteObject(CNavi_Object* object) { return buffer; } +// OFFSET: 0x00B92A70 +// FUNCTION: fn_19554 +NavigationTarget::NavigationTarget(int type, void* object) { + this->type = type; + this->object = object; + this->x = -1; + this->y = -1; +} + +// OFFSET: 0x00B93DE0 +// FUNCTION: fn_19566 +CNavi_Link* CNavigationManager::ReadObject(const char* record) { + const NaviObjectRecord* header = reinterpret_cast(record); + const int type = header->type; + if (static_cast(type - 199) > 100) { + return nullptr; + } + + const int index = header->index; + const int cellX = header->cellX; + const int cellY = header->cellY; + + std::size_t offset = 0x12; + int length = header->nameLength; + std::string name(record + offset, record + offset + length); + offset += length; + + length = *reinterpret_cast(record + offset); + offset += 2; + std::string title(record + offset, record + offset + length); + offset += length; + + length = *reinterpret_cast(record + offset); + offset += 2; + std::string map(record + offset, record + offset + length); + offset += length; + + const int unknown80 = *reinterpret_cast(record + offset); + const int unknown84 = *reinterpret_cast(record + offset + 4); + length = *reinterpret_cast(record + offset + 8); + offset += 10; + std::string linkedMap(record + offset, record + offset + length); + + CNaviInfo* info = this->FindObject(map.c_str()); + if (info == nullptr) { + return nullptr; + } + CNaviInfo* linkedInfo = this->FindObject(linkedMap.c_str()); + if (linkedInfo == nullptr) { + return nullptr; + } + return info->FindMatchingLink( + CNavi_Link(type, index, name.c_str(), title.c_str(), cellX, cellY, info, linkedInfo, unknown80, unknown84) + ); +} + // OFFSET: 0x00B950B0 // FUNCTION: fn_19571 void CNavigationManager::ClearSavedTarget() {