Merge pull request #1755 from ghoulslash/prankster_fix

Fix protect struct fields being set during ai calcs
This commit is contained in:
BuffelSaft 2021-10-16 17:59:30 +13:00 committed by GitHub
commit 4861f2eea2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -209,7 +209,11 @@ u8 BattleAI_ChooseMoveOrAction(void)
ret = ChooseMoveOrAction_Singles();
else
ret = ChooseMoveOrAction_Doubles();
// Clear protect structures, some flags may be set during AI calcs
// e.g. pranksterElevated from GetMovePriority
memset(&gProtectStructs[gActiveBattler], 0, sizeof(struct ProtectStruct));
gCurrentMove = savedCurrentMove;
return ret;
}

View File

@ -3097,6 +3097,7 @@ void FaintClearSetData(void)
gProtectStructs[gActiveBattler].usedThroatChopPreventedMove = 0;
gProtectStructs[gActiveBattler].statRaised = 0;
gProtectStructs[gActiveBattler].statFell = 0;
gProtectStructs[gActiveBattler].pranksterElevated = 0;
gDisableStructs[gActiveBattler].isFirstTurn = 2;