diff options
author | garak <garakmon@gmail.com> | 2018-11-27 13:31:07 -0500 |
---|---|---|
committer | garak <garakmon@gmail.com> | 2018-11-27 13:31:07 -0500 |
commit | 50f00b0827a4952a12f90009bd992f23c80a56af (patch) | |
tree | 6a5f78b04b42c162ed95cfc66c91a8b24f4051b2 /src/save_location.c | |
parent | f02cb667bbddf4f4a1152c86cbf9616468e7f0d2 (diff) | |
parent | c909aa92dee0a8d202d9195d80d0cc96b0d1ebc8 (diff) |
Merge remote-tracking branch 'upstream/master' into fldeff
Diffstat (limited to 'src/save_location.c')
-rw-r--r-- | src/save_location.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/save_location.c b/src/save_location.c index 262aaf40c..d49afa736 100644 --- a/src/save_location.c +++ b/src/save_location.c @@ -9,21 +9,18 @@ static bool32 IsCurMapInLocationList(const u16 *list) { + s32 i; u16 locSum = (gSaveBlock1Ptr->location.mapGroup << 8) + (gSaveBlock1Ptr->location.mapNum); - // im sure it was written a different way, but for the love of christ I cant figure out how to write it different where it still matches. - if (*list != 0xFFFF) + for (i = 0; list[i] != 0xFFFF; i++) { - u16 termValue = 0xFFFF; - const u16 *localList; - for (localList = list; *localList != termValue; localList++) - if (*localList == locSum) - return TRUE; + if (list[i] == locSum) + return TRUE; } + return FALSE; } -// TODO: Not require a packed u16 array for these lists static const u16 sSaveLocationPokeCenterList[] = { MAP_OLDALE_TOWN_POKEMON_CENTER_1F, @@ -72,7 +69,7 @@ static bool32 IsCurMapPokeCenter(void) return IsCurMapInLocationList(sSaveLocationPokeCenterList); } -static const u16 sSaveLocationReloadLocList[] = // there's only 1 location, and it's presumed its for the save reload feature for battle tower +static const u16 sSaveLocationReloadLocList[] = // There's only 1 location, and it's presumed its for the save reload feature for battle tower. { MAP_BATTLE_FRONTIER_BATTLE_TOWER_LOBBY, 0xFFFF, @@ -83,13 +80,13 @@ static bool32 IsCurMapReloadLocation(void) return IsCurMapInLocationList(sSaveLocationReloadLocList); } -// nulled out list. unknown what this would have been +// Nulled out list. Unknown what this would have been. static const u16 sUnknown_0861440E[] = { 0xFFFF, }; -bool32 sub_81AFCEC(void) +static bool32 sub_81AFCEC(void) { return IsCurMapInLocationList(sUnknown_0861440E); } |