diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2020-07-08 15:51:58 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-08 15:51:58 -0400 |
commit | ebb6c4ee661758874972956a94eb06d38eaa18a8 (patch) | |
tree | bccf414f4a854c2fd88290cbe5c221f56ba34f17 /src/fieldmap.c | |
parent | c0bc7e8f7b94ebab1e39b761aa194630e4c7bf6b (diff) | |
parent | 9ff261ac2a249a669a42381509ef288287535b4f (diff) |
Merge branch 'master' into doc-overworld
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 8e45add3f..49337ebbe 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; @@ -918,11 +925,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; |