summaryrefslogtreecommitdiff
path: root/src/save_location.c
diff options
context:
space:
mode:
authorDizzyEggg <jajkodizzy@wp.pl>2018-11-18 20:19:10 +0100
committerDizzyEggg <jajkodizzy@wp.pl>2018-11-18 20:19:10 +0100
commit27ee7d567e34b76c737c4920cfeccc36e6221543 (patch)
tree8df67f69c86109bb42e060100e2390ed20b33c61 /src/save_location.c
parent1b0cfb075723af7b457ec118eca2888df449bf9e (diff)
parent0bbe03f17030c8009508714fc2b41703f1a1310a (diff)
fix merge conflict and use EVENT_OBJECT_TEMPLATES_COUNT
Diffstat (limited to 'src/save_location.c')
-rw-r--r--src/save_location.c19
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);
}