mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-02-21 11:43:37 +01:00
Merge pull request #1755 from ghoulslash/prankster_fix
Fix protect struct fields being set during ai calcs
This commit is contained in:
commit
4861f2eea2
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user