From aa09cdea64e159808d439170f132ac1349afddf2 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 4 Nov 2026 15:23:21 +0000 Subject: [PATCH] Decompile fn_04357 (CWorldViewWorld::MapAt) Batch #10615 by dori: 0 byte-identical, 1 confirmed by peer review. - fn_04357 CWorldViewWorld::MapAt: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, kyoshi, 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 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Source/Contents/WorldView/WorldViewData.cpp b/Source/Contents/WorldView/WorldViewData.cpp index 0d760c48..798deedd 100644 --- a/Source/Contents/WorldView/WorldViewData.cpp +++ b/Source/Contents/WorldView/WorldViewData.cpp @@ -206,20 +206,22 @@ CWorldViewMap* CWorldViewWorld::FindMap(int id) { // OFFSET: 0x00613E00 // FUNCTION: fn_04357 CWorldViewMap* CWorldViewWorld::MapAt(unsigned int& mapIndex, int x, int y) { - const unsigned int count = this->maps.size(); - for (unsigned int index = 0; index < count; ++index) { - const CWorldViewMap* map = this->maps[index]; + 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; if (map->id < 100) { if (map->fields.empty()) { if (AreaContains(map->left, map->top, map->right, map->bottom, x, y)) { mapIndex = index; - return this->maps[index]; + return *it; } } else { const CWorldViewField* first = map->fields.front(); if (AreaContains(first->left, first->top, first->right, first->bottom, x, y)) { mapIndex = index; - return this->maps[index]; + return *it; } } }