2017-10-28 20:43:33 -04:00
|
|
|
#include "global.h"
|
|
|
|
#include "heal_location.h"
|
2020-03-20 03:04:38 -04:00
|
|
|
#include "constants/heal_locations.h"
|
2017-10-28 20:43:33 -04:00
|
|
|
|
2018-08-10 10:45:15 -04:00
|
|
|
#include "data/heal_locations.h"
|
2017-10-28 20:43:33 -04:00
|
|
|
|
2018-08-07 23:05:48 -04:00
|
|
|
u32 GetHealLocationIndexByMap(u16 mapGroup, u16 mapNum)
|
2017-10-28 20:55:01 -04:00
|
|
|
{
|
|
|
|
u32 i;
|
|
|
|
|
2018-08-07 23:05:48 -04:00
|
|
|
for (i = 0; i < ARRAY_COUNT(sHealLocations); i++)
|
2017-10-28 20:55:01 -04:00
|
|
|
{
|
2017-10-28 21:44:52 -04:00
|
|
|
if (sHealLocations[i].group == mapGroup && sHealLocations[i].map == mapNum)
|
2017-10-28 20:55:01 -04:00
|
|
|
return i + 1;
|
|
|
|
}
|
2022-06-03 14:59:01 +01:00
|
|
|
return HEAL_LOCATION_NONE;
|
2017-10-28 20:55:01 -04:00
|
|
|
}
|
|
|
|
|
2018-08-07 23:05:48 -04:00
|
|
|
const struct HealLocation *GetHealLocationByMap(u16 mapGroup, u16 mapNum)
|
2017-10-28 20:55:01 -04:00
|
|
|
{
|
2018-08-07 23:05:48 -04:00
|
|
|
u32 index = GetHealLocationIndexByMap(mapGroup, mapNum);
|
2017-10-28 20:55:01 -04:00
|
|
|
|
2022-06-03 14:59:01 +01:00
|
|
|
if (index == HEAL_LOCATION_NONE)
|
2017-10-28 20:55:01 -04:00
|
|
|
return NULL;
|
2018-08-07 23:05:48 -04:00
|
|
|
else
|
|
|
|
return &sHealLocations[index - 1];
|
2017-10-28 20:55:01 -04:00
|
|
|
}
|
|
|
|
|
2018-08-07 23:05:48 -04:00
|
|
|
const struct HealLocation *GetHealLocation(u32 index)
|
2017-10-28 20:55:01 -04:00
|
|
|
{
|
2022-06-03 14:59:01 +01:00
|
|
|
if (index == HEAL_LOCATION_NONE)
|
2017-10-28 20:55:01 -04:00
|
|
|
return NULL;
|
2018-08-07 23:05:48 -04:00
|
|
|
else if (index > ARRAY_COUNT(sHealLocations))
|
2017-10-28 20:55:01 -04:00
|
|
|
return NULL;
|
2018-08-07 23:05:48 -04:00
|
|
|
else
|
|
|
|
return &sHealLocations[index - 1];
|
2017-10-28 20:55:01 -04:00
|
|
|
}
|