diff options
Diffstat (limited to 'src/fieldmap.c')
-rw-r--r-- | src/fieldmap.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/fieldmap.c b/src/fieldmap.c index e953e0f93..cfc7018bd 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -533,9 +533,16 @@ static bool32 SavedMapViewIsEmpty(void) u16 i; u32 marker = 0; +#ifndef UBFIX // BUG: This loop extends past the bounds of the mapView array. Its size is only 0x100. for (i = 0; i < 0x200; i++) marker |= gSaveBlock1Ptr->mapView[i]; +#else + // UBFIX: Only iterate over 0x100 + for (i = 0; i < ARRAY_COUNT(gSaveBlock1Ptr->mapView); i++) + marker |= gSaveBlock1Ptr->mapView[i]; +#endif + if (marker == 0) return TRUE; @@ -917,11 +924,11 @@ void GetCameraCoords(u16 *x, u16 *y) *y = gSaveBlock1Ptr->pos.y; } -void sub_8088B94(int x, int y, int a2) +void MapGridSetMetatileImpassabilityAt(int x, int y, bool32 impassable) { if (x >= 0 && x < gBackupMapLayout.width && y >= 0 && y < gBackupMapLayout.height) { - if (a2 != 0) + if (impassable) gBackupMapLayout.map[x + gBackupMapLayout.width * y] |= METATILE_COLLISION_MASK; else gBackupMapLayout.map[x + gBackupMapLayout.width * y] &= ~METATILE_COLLISION_MASK; |