diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2020-07-08 16:03:32 -0400 |
---|---|---|
committer | GriffinR <griffin.g.richards@gmail.com> | 2020-07-08 16:03:32 -0400 |
commit | beeb673ba16e02cacadb2de0ee3608d2106ed14a (patch) | |
tree | 8924e783fc8af67286cf45abcef95c065a3fd223 /src/fieldmap.c | |
parent | 2ed1f7c6f92abe93d86b921709576b82970f0848 (diff) | |
parent | ebade7affb31d5bcdc17cdcd3895758010ee6f66 (diff) |
Merge branch 'master' of https://github.com/pret/pokeemerald into add-flagvarsave
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; |