diff options
author | nullableVoidPtr <30564701+nullableVoidPtr@users.noreply.github.com> | 2018-11-29 19:24:28 +0800 |
---|---|---|
committer | nullableVoidPtr <30564701+nullableVoidPtr@users.noreply.github.com> | 2018-12-06 09:44:08 +0800 |
commit | 3909b6408c0125fe311d49a3029a2806993615f7 (patch) | |
tree | a02365a6eb268dce08941968e11e319f3a7fe080 /src/apprentice.c | |
parent | 1b33ad6c26fa83aa7b77055ddde59c61df03d0e4 (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/apprentice.c')
-rw-r--r-- | src/apprentice.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/apprentice.c b/src/apprentice.c index 499f85094..faed3756c 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -9,7 +9,7 @@ #include "item.h" #include "item_menu.h" #include "main.h" -#include "malloc.h" +#include "alloc.h" #include "menu.h" #include "new_game.h" #include "party_menu.h" @@ -1079,7 +1079,7 @@ void ResetApprenticeStruct(struct Apprentice *apprentice) u8 i; for (i = 0; i < 6; i++) - apprentice->easyChatWords[i] |= 0xFFFF; + apprentice->easyChatWords[i] |= INVALID_U16; apprentice->playerName[0] = EOS; apprentice->id = 16; @@ -1093,7 +1093,7 @@ void ResetAllApprenticeData(void) for (i = 0; i < 4; i++) { for (j = 0; j < 6; j++) - gSaveBlock2Ptr->apprentices[i].easyChatWords[j] |= 0xFFFF; + gSaveBlock2Ptr->apprentices[i].easyChatWords[j] |= INVALID_U16; gSaveBlock2Ptr->apprentices[i].id = 16; gSaveBlock2Ptr->apprentices[i].playerName[0] = EOS; gSaveBlock2Ptr->apprentices[i].lvlMode = 0; @@ -1290,7 +1290,7 @@ static u16 sub_819FF98(u8 arg0) else level = 60; - for (j = 0; learnset[j] != 0xFFFF; j++) + for (j = 0; learnset[j] != INVALID_U16; j++) { if ((learnset[j] & 0xFE00) > (level << 9)) break; @@ -1393,7 +1393,7 @@ static void GetLatestLearnedMoves(u16 species, u16 *moves) level = 60; learnset = gLevelUpLearnsets[species]; - for (i = 0; learnset[i] != 0xFFFF; i++) + for (i = 0; learnset[i] != INVALID_U16; i++) { if ((learnset[i] & 0xFE00) > (level << 9)) break; @@ -2236,7 +2236,7 @@ static void sub_81A1370(void) } r10 = 0xFFFF; - r9 = -1; + r9 = INVALID_S32; for (i = 1; i < 4; i++) { if (GetTrainerId(gSaveBlock2Ptr->apprentices[i].playerId) == GetTrainerId(gSaveBlock2Ptr->playerTrainerId) |