mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-29 14:53:55 +01:00
fix protect struct fields being set during ai calcs
This commit is contained in:
parent
e66820e646
commit
5108d173fc
@ -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