From 2dd706ca5410d98ad214ceff7026d6db276f4d5a Mon Sep 17 00:00:00 2001 From: melthelesbian <44884535+melthelesbian@users.noreply.github.com> Date: Tue, 25 Dec 2018 12:50:15 -0500 Subject: use max mon moves constant where able (#480) * use max mon moves constant where able * fix errors in script commands file * fix more errors --- src/daycare.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/daycare.c') diff --git a/src/daycare.c b/src/daycare.c index 26fa0251e..6bdbd987e 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -636,7 +636,7 @@ static void BuildEggMoveset(struct Pokemon *egg, struct BoxPokemon *father, stru u16 i, j; numSharedParentMoves = 0; - for (i = 0; i < 4; i++) + for (i = 0; i < MAX_MON_MOVES; i++) { sHatchedEggMotherMoves[i] = 0; sHatchedEggFatherMoves[i] = 0; @@ -648,7 +648,7 @@ static void BuildEggMoveset(struct Pokemon *egg, struct BoxPokemon *father, stru sHatchedEggLevelUpMoves[i] = 0; numLevelUpMoves = GetLevelUpMovesBySpecies(GetMonData(egg, MON_DATA_SPECIES), sHatchedEggLevelUpMoves); - for (i = 0; i < 4; i++) + for (i = 0; i < MAX_MON_MOVES; i++) { sHatchedEggFatherMoves[i] = GetBoxMonData(father, MON_DATA_MOVE1 + i); sHatchedEggMotherMoves[i] = GetBoxMonData(mother, MON_DATA_MOVE1 + i); @@ -656,7 +656,7 @@ static void BuildEggMoveset(struct Pokemon *egg, struct BoxPokemon *father, stru numEggMoves = GetEggMoves(egg, sHatchedEggEggMoves); - for (i = 0; i < 4; i++) + for (i = 0; i < MAX_MON_MOVES; i++) { if (sHatchedEggFatherMoves[i] != MOVE_NONE) { @@ -675,7 +675,7 @@ static void BuildEggMoveset(struct Pokemon *egg, struct BoxPokemon *father, stru break; } } - for (i = 0; i < 4; i++) + for (i = 0; i < MAX_MON_MOVES; i++) { if (sHatchedEggFatherMoves[i] != MOVE_NONE) { @@ -689,18 +689,18 @@ static void BuildEggMoveset(struct Pokemon *egg, struct BoxPokemon *father, stru } } } - for (i = 0; i < 4; i++) + for (i = 0; i < MAX_MON_MOVES; i++) { if (sHatchedEggFatherMoves[i] == MOVE_NONE) break; - for (j = 0; j < 4; j++) + for (j = 0; j < MAX_MON_MOVES; j++) { if (sHatchedEggFatherMoves[i] == sHatchedEggMotherMoves[j] && sHatchedEggFatherMoves[i] != MOVE_NONE) sHatchedEggFinalMoves[numSharedParentMoves++] = sHatchedEggFatherMoves[i]; } } - for (i = 0; i < 4; i++) + for (i = 0; i < MAX_MON_MOVES; i++) { if (sHatchedEggFinalMoves[i] == MOVE_NONE) break; -- cgit v1.2.3