Skip to content

Commit

Permalink
fix broken move anims in tests (#3398)
Browse files Browse the repository at this point in the history
  • Loading branch information
DizzyEggg committed Oct 11, 2023
1 parent 70fbf9e commit 4033260
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion include/test/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,6 @@ struct BattleTestData
u8 aiActionsPlayed[MAX_BATTLERS_COUNT];
struct ExpectedAIAction expectedAiActions[MAX_BATTLERS_COUNT][MAX_EXPECTED_ACTIONS];
struct ExpectedAiScore expectedAiScores[MAX_BATTLERS_COUNT][MAX_TURNS][MAX_AI_SCORE_COMPARISION_PER_TURN]; // Max 4 comparisions per turn
struct AILogLine aiLogLines[MAX_BATTLERS_COUNT][MAX_MON_MOVES][MAX_AI_LOG_LINES];
u8 aiLogPrintedForMove[MAX_BATTLERS_COUNT]; // Marks ai score log as printed for move, so the same log isn't displayed multiple times.
};

Expand Down
7 changes: 4 additions & 3 deletions test/test_runner_battle.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#undef Q_4_12
#define Q_4_12(n) (s32)((n) * 4096)

static EWRAM_DATA struct AILogLine sAILogLines[MAX_BATTLERS_COUNT][MAX_MON_MOVES][MAX_AI_LOG_LINES] = {0};
EWRAM_DATA struct BattleTestRunnerState *gBattleTestRunnerState = NULL;

static void CB2_BattleTest_NextParameter(void);
Expand Down Expand Up @@ -937,7 +938,7 @@ static void PrintAiMoveLog(u32 battlerId, u32 moveSlot, u32 moveId, s32 totalSco
MgbaPrintf_("Score Log for move %S:\n", gMoveNames[moveId]);
for (i = 0; i < MAX_AI_LOG_LINES; i++)
{
struct AILogLine *log = &DATA.aiLogLines[battlerId][moveSlot][i];
struct AILogLine *log = &sAILogLines[battlerId][moveSlot][i];
if (log->file)
{
if (log->set)
Expand Down Expand Up @@ -973,7 +974,7 @@ static void ClearAiLog(u32 battlerId)
u32 i, j;
for (i = 0; i < MAX_MON_MOVES; i++)
{
struct AILogLine *logs = DATA.aiLogLines[battlerId][i];
struct AILogLine *logs = sAILogLines[battlerId][i];
for (j = 0; j < MAX_AI_LOG_LINES; j++)
memset(&logs[j], 0, sizeof(struct AILogLine));
}
Expand Down Expand Up @@ -2551,7 +2552,7 @@ struct AILogLine *GetLogLine(u32 battlerId, u32 moveIndex)

for (i = 0; i < MAX_AI_LOG_LINES; i++)
{
struct AILogLine *log = &DATA.aiLogLines[battlerId][moveIndex][i];
struct AILogLine *log = &sAILogLines[battlerId][moveIndex][i];
if (log->file == NULL)
{
return log;
Expand Down

0 comments on commit 4033260

Please sign in to comment.