summaryrefslogtreecommitdiff
path: root/src/wild_encounter.c
diff options
context:
space:
mode:
authornullableVoidPtr <30564701+nullableVoidPtr@users.noreply.github.com>2018-11-29 19:24:28 +0800
committernullableVoidPtr <30564701+nullableVoidPtr@users.noreply.github.com>2018-12-06 09:44:08 +0800
commit3909b6408c0125fe311d49a3029a2806993615f7 (patch)
treea02365a6eb268dce08941968e11e319f3a7fe080 /src/wild_encounter.c
parent1b33ad6c26fa83aa7b77055ddde59c61df03d0e4 (diff)
Fix alloc.c as per #386, define INVALID_ constants and rename malloc to alloc as per #325
Some of the INVALID_ are likely erroneously placed, due to lack of documentation
Diffstat (limited to 'src/wild_encounter.c')
-rw-r--r--src/wild_encounter.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/wild_encounter.c b/src/wild_encounter.c
index 9b3c70ad7..8fb7d08d6 100644
--- a/src/wild_encounter.c
+++ b/src/wild_encounter.c
@@ -4825,7 +4825,7 @@ static u16 GetCurrentMapWildMonHeaderId(void)
for (i = 0; ; i++)
{
const struct WildPokemonHeader *wildHeader = &gWildMonHeaders[i];
- if (wildHeader->mapGroup == 0xFF)
+ if (wildHeader->mapGroup == INVALID_U8)
break;
if (gWildMonHeaders[i].mapGroup == gSaveBlock1Ptr->location.mapGroup &&
@@ -4845,7 +4845,7 @@ static u16 GetCurrentMapWildMonHeaderId(void)
}
}
- return -1;
+ return INVALID_S16;
}
static u8 PickWildMonNature(void)
@@ -5079,7 +5079,7 @@ bool8 StandardWildEncounter(u16 currMetaTileBehavior, u16 previousMetaTileBehavi
return FALSE;
headerId = GetCurrentMapWildMonHeaderId();
- if (headerId == 0xFFFF) // invalid
+ if (headerId == INVALID_U16)
{
if (gMapHeader.mapLayoutId == 0x166)
{
@@ -5190,7 +5190,7 @@ void RockSmashWildEncounter(void)
{
u16 headerId = GetCurrentMapWildMonHeaderId();
- if (headerId != 0xFFFF)
+ if (headerId != INVALID_U16)
{
const struct WildPokemonInfo *wildPokemonInfo = gWildMonHeaders[headerId].rockSmashMonsInfo;
@@ -5222,7 +5222,7 @@ bool8 SweetScentWildEncounter(void)
PlayerGetDestCoords(&x, &y);
headerId = GetCurrentMapWildMonHeaderId();
- if (headerId == 0xFFFF) // invalid
+ if (headerId == INVALID_U16)
{
if (gMapHeader.mapLayoutId == 0x166)
{
@@ -5292,7 +5292,7 @@ bool8 DoesCurrentMapHaveFishingMons(void)
{
u16 headerId = GetCurrentMapWildMonHeaderId();
- if (headerId != 0xFFFF && gWildMonHeaders[headerId].fishingMonsInfo != NULL)
+ if (headerId != INVALID_U16 && gWildMonHeaders[headerId].fishingMonsInfo != NULL)
return TRUE;
else
return FALSE;
@@ -5326,7 +5326,7 @@ u16 GetLocalWildMon(bool8 *isWaterMon)
*isWaterMon = FALSE;
headerId = GetCurrentMapWildMonHeaderId();
- if (headerId == 0xFFFF)
+ if (headerId == INVALID_U16)
return SPECIES_NONE;
landMonsInfo = gWildMonHeaders[headerId].landMonsInfo;
waterMonsInfo = gWildMonHeaders[headerId].waterMonsInfo;
@@ -5358,7 +5358,7 @@ u16 GetLocalWaterMon(void)
{
u16 headerId = GetCurrentMapWildMonHeaderId();
- if (headerId != 0xFFFF)
+ if (headerId != INVALID_U16)
{
const struct WildPokemonInfo *waterMonsInfo = gWildMonHeaders[headerId].waterMonsInfo;