From f1421d94c384c1bd76304fcb961ca28d7f0e7e20 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 15 Dec 2018 23:58:47 +0100 Subject: Up to sub 0x80ce580 --- src/pokemon.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/pokemon.c') diff --git a/src/pokemon.c b/src/pokemon.c index eec995050..aea52ecbb 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -4097,13 +4097,13 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data) case MON_DATA_LANGUAGE: retVal = boxMon->language; break; - case MON_DATA_SANITY_BIT1: + case MON_DATA_SANITY_IS_BAD_EGG: retVal = boxMon->isBadEgg; break; - case MON_DATA_SANITY_BIT2: + case MON_DATA_SANITY_HAS_SPECIES: retVal = boxMon->hasSpecies; break; - case MON_DATA_SANITY_BIT3: + case MON_DATA_SANITY_IS_EGG: retVal = boxMon->isEgg; break; case MON_DATA_OT_NAME: @@ -4304,7 +4304,7 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data) u16 *moves = (u16 *)data; s32 i = 0; - while (moves[i] != 355) + while (moves[i] != MOVES_COUNT) { u16 move = moves[i]; if (substruct1->moves[0] == move @@ -4466,13 +4466,13 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg) case MON_DATA_LANGUAGE: SET8(boxMon->language); break; - case MON_DATA_SANITY_BIT1: + case MON_DATA_SANITY_IS_BAD_EGG: SET8(boxMon->isBadEgg); break; - case MON_DATA_SANITY_BIT2: + case MON_DATA_SANITY_HAS_SPECIES: SET8(boxMon->hasSpecies); break; - case MON_DATA_SANITY_BIT3: + case MON_DATA_SANITY_IS_EGG: SET8(boxMon->isEgg); break; case MON_DATA_OT_NAME: @@ -4897,7 +4897,7 @@ bool8 IsPokemonStorageFull(void) for (i = 0; i < 14; i++) for (j = 0; j < 30; j++) - if (GetBoxMonDataFromAnyBox(i, j, MON_DATA_SPECIES) == SPECIES_NONE) + if (GetBoxMonDataAt(i, j, MON_DATA_SPECIES) == SPECIES_NONE) return FALSE; return TRUE; @@ -6859,7 +6859,7 @@ void SetWildMonHeldItem(void) u16 species = GetMonData(&gEnemyParty[0], MON_DATA_SPECIES, 0); u16 var1 = 45; u16 var2 = 95; - if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_BIT3, 0) + if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG, 0) && GetMonAbility(&gPlayerParty[0]) == ABILITY_COMPOUND_EYES) { var1 = 20; -- cgit v1.2.3 From 1374c11a1c029c26c19daaea67ddeeb7bbd246c7 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Fri, 21 Dec 2018 22:35:01 +0100 Subject: Review pokemon storage system chaanges --- src/pokemon.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/pokemon.c') diff --git a/src/pokemon.c b/src/pokemon.c index 1e8126c5e..6700ef553 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -4722,7 +4722,7 @@ u8 SendMonToPC(struct Pokemon* mon) do { - for (boxPos = 0; boxPos < 30; boxPos++) + for (boxPos = 0; boxPos < IN_BOX_COUNT; boxPos++) { struct BoxPokemon* checkingMon = GetBoxedMonPtr(boxNo, boxPos); if (GetBoxMonData(checkingMon, MON_DATA_SPECIES, NULL) == SPECIES_NONE) @@ -4739,7 +4739,7 @@ u8 SendMonToPC(struct Pokemon* mon) } boxNo++; - if (boxNo == 14) + if (boxNo == TOTAL_BOXES_COUNT) boxNo = 0; } while (boxNo != StorageGetCurrentBox()); @@ -4889,8 +4889,8 @@ bool8 IsPokemonStorageFull(void) { s32 i, j; - for (i = 0; i < 14; i++) - for (j = 0; j < 30; j++) + for (i = 0; i < TOTAL_BOXES_COUNT; i++) + for (j = 0; j < IN_BOX_COUNT; j++) if (GetBoxMonDataAt(i, j, MON_DATA_SPECIES) == SPECIES_NONE) return FALSE; -- cgit v1.2.3