From 5b3596108de3d6de9914b66052b13a7745d30ea3 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 12 Jan 2023 10:51:20 -0500 Subject: [PATCH] Add some missing PARTY_SIZE usage --- src/battle_ai_switch_items.c | 2 +- src/battle_controller_opponent.c | 8 ++++---- src/battle_controller_player_partner.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 0aec2316e..798c014c2 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -751,7 +751,7 @@ u8 GetMostSuitableMonToSwitchInto(void) gMoveResultFlags = 0; gCritMultiplier = 1; bestDmg = 0; - bestMonId = 6; + bestMonId = PARTY_SIZE; // If we couldn't find the best mon in terms of typing, find the one that deals most damage. for (i = firstId; i < lastId; i++) diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index b3554dc5a..8246a6f80 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1151,7 +1151,7 @@ static void OpponentHandleLoadMonSprite(void) static void OpponentHandleSwitchInAnim(void) { - *(gBattleStruct->monToSwitchIntoId + gActiveBattler) = 6; + *(gBattleStruct->monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; gBattlerPartyIndexes[gActiveBattler] = gBattleBufferA[gActiveBattler][1]; StartSendOutAnim(gActiveBattler, gBattleBufferA[gActiveBattler][2]); gBattlerControllerFuncs[gActiveBattler] = SwitchIn_TryShinyAnim; @@ -1635,13 +1635,13 @@ static void OpponentHandleChoosePokemon(void) if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TOWER_LINK_MULTI)) { if (gActiveBattler == 1) - firstId = 0, lastId = 3; + firstId = 0, lastId = PARTY_SIZE / 2; else - firstId = 3, lastId = 6; + firstId = PARTY_SIZE / 2, lastId = PARTY_SIZE; } else { - firstId = 0, lastId = 6; + firstId = 0, lastId = PARTY_SIZE; } for (chosenMonId = firstId; chosenMonId < lastId; chosenMonId++) diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index cc134b92e..b8ee6692c 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -1540,12 +1540,12 @@ static void PlayerPartnerHandleChoosePokemon(void) { s32 chosenMonId = GetMostSuitableMonToSwitchInto(); - if (chosenMonId == 6) // just switch to the next mon + if (chosenMonId == PARTY_SIZE) // just switch to the next mon { u8 playerMonIdentity = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); u8 selfIdentity = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT); - for (chosenMonId = 3; chosenMonId < 6; chosenMonId++) + for (chosenMonId = PARTY_SIZE / 2; chosenMonId < PARTY_SIZE; chosenMonId++) { if (GetMonData(&gPlayerParty[chosenMonId], MON_DATA_HP) != 0 && chosenMonId != gBattlerPartyIndexes[playerMonIdentity]