From 65a0cb0721d68709d0a927263aab1d8edb5d3f69 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 5 Nov 2026 15:45:56 +0000 Subject: [PATCH] Decompile fn_04357 (CWorldViewWorld::MapAt) Batch #12467 by dori: 0 byte-identical, 1 confirmed by peer review. - fn_04357 CWorldViewWorld::MapAt: logic confirmed by peer review Peer-reviewed-by: Yommy, cremane Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/WorldView/WorldViewData.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Source/Contents/WorldView/WorldViewData.cpp b/Source/Contents/WorldView/WorldViewData.cpp index e9ee091c1..edb8f05b7 100644 --- a/Source/Contents/WorldView/WorldViewData.cpp +++ b/Source/Contents/WorldView/WorldViewData.cpp @@ -211,22 +211,19 @@ __declspec(noinline) CWorldViewMap* CWorldViewWorld::FindMap(int id) { // OFFSET: 0x00613E00 // FUNCTION: fn_04357 CWorldViewMap* CWorldViewWorld::MapAt(unsigned int& mapIndex, int x, int y) { - unsigned int index = 0; - std::vector::const_iterator it = this->maps.begin(); - const std::vector::const_iterator end = this->maps.end(); - for (; it != end; ++it, ++index) { - const CWorldViewMap* map = *it; + for (unsigned int index = 0; index < this->maps.size(); ++index) { + CWorldViewMap* map = this->maps[index]; if (map->id < 100) { if (map->fields.empty()) { if (AreaContains(map->left, map->top, map->right, map->bottom, x, y)) { mapIndex = index; - return *it; + return map; } } else { const CWorldViewField* first = map->fields.front(); if (AreaContains(first->left, first->top, first->right, first->bottom, x, y)) { mapIndex = index; - return *it; + return map; } } }