summaryrefslogtreecommitdiff
path: root/src/heal_location.c
diff options
context:
space:
mode:
authorCameron Hall <camthesaxman@users.noreply.github.com>2016-11-06 23:02:20 -0600
committerYamaArashi <YamaArashi@users.noreply.github.com>2016-11-06 21:02:20 -0800
commit7b1e836e9b48fd54a227931942d231f1c0823626 (patch)
tree7a987a7be6724b10704ac106d522ba6366671b07 /src/heal_location.c
parent7f5332c12025c36c90c647184a5a4b1a3433d200 (diff)
cleanup (#93)
* cleanup * cleanup
Diffstat (limited to 'src/heal_location.c')
-rw-r--r--src/heal_location.c36
1 files changed, 6 insertions, 30 deletions
diff --git a/src/heal_location.c b/src/heal_location.c
index 15c4c7105..da2e466a9 100644
--- a/src/heal_location.c
+++ b/src/heal_location.c
@@ -12,58 +12,34 @@ struct HealLocation
extern const struct HealLocation gHealLocations[];
-u32 GetHealLocationIndexByMap(u16 some_group, u16 some_map)
+u32 GetHealLocationIndexByMap(u16 mapGroup, u16 mapNum)
{
- u32 i = 0;
+ u32 i;
- const struct HealLocation *temp = gHealLocations;
-
- for (; i<NUM_HEAL_LOCATIONS; i++)
+ for (i = 0; i < NUM_HEAL_LOCATIONS; i++)
{
- if (temp->group != some_group)
- {
- temp++;
- }
- else if (temp->map != some_map)
- {
- temp++;
- }
- else
- {
+ if(gHealLocations[i].group == mapGroup && gHealLocations[i].map == mapNum)
return i + 1;
- }
}
-
return 0;
}
-const struct HealLocation *GetHealLocationByMap(u16 some_group,
- u16 some_map)
+const struct HealLocation *GetHealLocationByMap(u16 mapGroup, u16 mapNum)
{
- u32 index = GetHealLocationIndexByMap(some_group, some_map);
+ u32 index = GetHealLocationIndexByMap(mapGroup, mapNum);
if (index == 0)
- {
return NULL;
- }
else
- {
return &gHealLocations[index - 1];
- }
}
const struct HealLocation *GetHealLocation(u32 index)
{
if (index == 0)
- {
return NULL;
- }
else if (index > NUM_HEAL_LOCATIONS)
- {
return NULL;
- }
else
- {
return &gHealLocations[index - 1];
- }
}