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).
This commit is contained in:
parent
cc0aa64240
commit
65a0cb0721
1 changed files with 4 additions and 7 deletions
|
|
@ -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<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;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue