Skip to content

Commit

Permalink
Bugfix for ChooseMoveOrAction_Doubles.
Browse files Browse the repository at this point in the history
  • Loading branch information
luckytyphlosion committed Nov 7, 2020
1 parent a29b18e commit 4b748d3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/battle_ai_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,16 @@ static u8 ChooseMoveOrAction_Doubles(void)
{
s32 i;
s32 j;
#ifndef BUGFIX
s32 scriptsToRun;
#else
// the value assigned to this is a u32 (aiFlags)
// this becomes relevant because aiFlags can have bit 31 set
// and scriptsToRun is shifted
// this never happens in the vanilla game because bit 31 is
// only set when it's the first battle
u32 scriptsToRun;
#endif
s16 bestMovePointsForTarget[MAX_BATTLERS_COUNT];
s8 mostViableTargetsArray[MAX_BATTLERS_COUNT];
u8 actionOrMoveIndex[MAX_BATTLERS_COUNT];
Expand Down

0 comments on commit 4b748d3

Please sign in to comment.