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).
This commit is contained in:
parent
878abda998
commit
aa09cdea64
1 changed files with 7 additions and 5 deletions
|
|
@ -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<CWorldViewMap*>::const_iterator it = this->maps.begin();
|
||||
const std::vector<CWorldViewMap*>::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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue