Skip to content

Commit

Permalink
Fix recorded battle link player loops (#2071)
Browse files Browse the repository at this point in the history
  • Loading branch information
AsparagusEduardo authored Dec 4, 2024
1 parent 4beb0ef commit e605ffb
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/recorded_battle.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ struct RecordedBattleSave
{
struct Pokemon playerParty[PARTY_SIZE];
struct Pokemon opponentParty[PARTY_SIZE];
u8 playersName[MAX_BATTLERS_COUNT][PLAYER_NAME_LENGTH + 1];
u8 playersGender[MAX_BATTLERS_COUNT];
u32 playersTrainerId[MAX_BATTLERS_COUNT];
u8 playersLanguage[MAX_BATTLERS_COUNT];
u8 playersName[MAX_LINK_PLAYERS][PLAYER_NAME_LENGTH + 1];
u8 playersGender[MAX_LINK_PLAYERS];
u32 playersTrainerId[MAX_LINK_PLAYERS];
u8 playersLanguage[MAX_LINK_PLAYERS];
u32 rngSeed;
u32 battleFlags;
u8 playersBattlers[MAX_BATTLERS_COUNT];
u8 playersBattlers[MAX_LINK_PLAYERS];
u16 opponentA;
u16 opponentB;
u16 partnerId;
Expand Down Expand Up @@ -85,7 +85,7 @@ EWRAM_DATA static u32 sAI_Scripts = 0;
EWRAM_DATA static struct Pokemon sSavedPlayerParty[PARTY_SIZE] = {0};
EWRAM_DATA static struct Pokemon sSavedOpponentParty[PARTY_SIZE] = {0};
EWRAM_DATA static u16 sPlayerMonMoves[MAX_BATTLERS_COUNT / 2][MAX_MON_MOVES] = {0};
EWRAM_DATA static struct PlayerInfo sPlayers[MAX_BATTLERS_COUNT] = {0};
EWRAM_DATA static struct PlayerInfo sPlayers[MAX_LINK_PLAYERS] = {0};
EWRAM_DATA static bool8 sIsPlaybackFinished = 0;
EWRAM_DATA static u8 sRecordMixFriendName[PLAYER_NAME_LENGTH + 1] = {0};
EWRAM_DATA static u8 sRecordMixFriendClass = 0;
Expand Down Expand Up @@ -148,7 +148,7 @@ void RecordedBattle_SetTrainerInfo(void)
gRecordedBattleMultiplayerId = GetMultiplayerId();
linkPlayersCount = GetLinkPlayerCount();

for (i = 0; i < MAX_BATTLERS_COUNT; i++)
for (i = 0; i < MAX_LINK_PLAYERS; i++)
{
sPlayers[i].trainerId = gLinkPlayers[i].trainerId;
sPlayers[i].gender = gLinkPlayers[i].gender;
Expand Down Expand Up @@ -333,7 +333,7 @@ bool32 MoveRecordedBattleToSaveData(void)
battleSave->opponentParty[i] = sSavedOpponentParty[i];
}

for (i = 0; i < MAX_BATTLERS_COUNT; i++)
for (i = 0; i < MAX_LINK_PLAYERS; i++)
{
for (j = 0; j < PLAYER_NAME_LENGTH + 1; j++)
battleSave->playersName[i][j] = sPlayers[i].name[j];
Expand Down Expand Up @@ -535,7 +535,7 @@ static void SetVariablesForRecordedBattle(struct RecordedBattleSave *src)
gEnemyParty[i] = src->opponentParty[i];
}

for (i = 0; i < MAX_BATTLERS_COUNT; i++)
for (i = 0; i < MAX_LINK_PLAYERS; i++)
{
for (var = FALSE, j = 0; j < PLAYER_NAME_LENGTH + 1; j++)
{
Expand Down

0 comments on commit e605ffb

Please sign in to comment.