Add some missing PARTY_SIZE usage

This commit is contained in:
GriffinR
2023-01-12 10:51:20 -05:00
parent 6d6a876dbd
commit 5b3596108d
3 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -751,7 +751,7 @@ u8 GetMostSuitableMonToSwitchInto(void)
gMoveResultFlags = 0; gMoveResultFlags = 0;
gCritMultiplier = 1; gCritMultiplier = 1;
bestDmg = 0; 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. // 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++) for (i = firstId; i < lastId; i++)
+4 -4
View File
@@ -1151,7 +1151,7 @@ static void OpponentHandleLoadMonSprite(void)
static void OpponentHandleSwitchInAnim(void) static void OpponentHandleSwitchInAnim(void)
{ {
*(gBattleStruct->monToSwitchIntoId + gActiveBattler) = 6; *(gBattleStruct->monToSwitchIntoId + gActiveBattler) = PARTY_SIZE;
gBattlerPartyIndexes[gActiveBattler] = gBattleBufferA[gActiveBattler][1]; gBattlerPartyIndexes[gActiveBattler] = gBattleBufferA[gActiveBattler][1];
StartSendOutAnim(gActiveBattler, gBattleBufferA[gActiveBattler][2]); StartSendOutAnim(gActiveBattler, gBattleBufferA[gActiveBattler][2]);
gBattlerControllerFuncs[gActiveBattler] = SwitchIn_TryShinyAnim; gBattlerControllerFuncs[gActiveBattler] = SwitchIn_TryShinyAnim;
@@ -1635,13 +1635,13 @@ static void OpponentHandleChoosePokemon(void)
if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TOWER_LINK_MULTI)) if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TOWER_LINK_MULTI))
{ {
if (gActiveBattler == 1) if (gActiveBattler == 1)
firstId = 0, lastId = 3; firstId = 0, lastId = PARTY_SIZE / 2;
else else
firstId = 3, lastId = 6; firstId = PARTY_SIZE / 2, lastId = PARTY_SIZE;
} }
else else
{ {
firstId = 0, lastId = 6; firstId = 0, lastId = PARTY_SIZE;
} }
for (chosenMonId = firstId; chosenMonId < lastId; chosenMonId++) for (chosenMonId = firstId; chosenMonId < lastId; chosenMonId++)
+2 -2
View File
@@ -1540,12 +1540,12 @@ static void PlayerPartnerHandleChoosePokemon(void)
{ {
s32 chosenMonId = GetMostSuitableMonToSwitchInto(); 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 playerMonIdentity = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);
u8 selfIdentity = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT); 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 if (GetMonData(&gPlayerParty[chosenMonId], MON_DATA_HP) != 0
&& chosenMonId != gBattlerPartyIndexes[playerMonIdentity] && chosenMonId != gBattlerPartyIndexes[playerMonIdentity]