Add the HEAL_LOCATION_NONE constant

This commit is contained in:
sphericalice
2022-06-03 14:59:01 +01:00
parent a7b6dfee3a
commit 35bdaccedc
4 changed files with 45 additions and 44 deletions

View File

@@ -13,14 +13,14 @@ u32 GetHealLocationIndexByMap(u16 mapGroup, u16 mapNum)
if (sHealLocations[i].group == mapGroup && sHealLocations[i].map == mapNum)
return i + 1;
}
return 0;
return HEAL_LOCATION_NONE;
}
const struct HealLocation *GetHealLocationByMap(u16 mapGroup, u16 mapNum)
{
u32 index = GetHealLocationIndexByMap(mapGroup, mapNum);
if (index == 0)
if (index == HEAL_LOCATION_NONE)
return NULL;
else
return &sHealLocations[index - 1];
@@ -28,7 +28,7 @@ const struct HealLocation *GetHealLocationByMap(u16 mapGroup, u16 mapNum)
const struct HealLocation *GetHealLocation(u32 index)
{
if (index == 0)
if (index == HEAL_LOCATION_NONE)
return NULL;
else if (index > ARRAY_COUNT(sHealLocations))
return NULL;