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