Clear BattleScripting struct at the battle start (#3776)

This commit is contained in:
DizzyEggg 2023-12-20 11:48:52 +01:00 committed by GitHub
parent 069769710b
commit 3b7782ed49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2961,6 +2961,10 @@ static void BattleStartClearSetData(void)
memset(&gSideTimers, 0, sizeof(gSideTimers));
memset(&gWishFutureKnock, 0, sizeof(gWishFutureKnock));
memset(&gBattleResults, 0, sizeof(gBattleResults));
memset(&gBattleScripting, 0, sizeof(gBattleScripting));
gBattleScripting.battleStyle = gSaveBlock2Ptr->optionsBattleStyle;
gBattleScripting.expOnCatch = (B_EXP_CATCH >= GEN_6);
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
{
@ -2997,7 +3001,6 @@ static void BattleStartClearSetData(void)
gBattlerAttacker = 0;
gBattlerTarget = 0;
gEffectBattler = 0;
gBattleScripting.battler = 0;
gBattlerAbility = 0;
gBattleWeather = 0;
gHitMarker = 0;
@ -3012,12 +3015,7 @@ static void BattleStartClearSetData(void)
gHitMarker |= HITMARKER_NO_ANIMATIONS;
}
gBattleScripting.battleStyle = gSaveBlock2Ptr->optionsBattleStyle;
gBattleScripting.expOnCatch = (B_EXP_CATCH >= GEN_6);
gBattleScripting.monCaught = FALSE;
gMultiHitCounter = 0;
gBattleScripting.savedDmg = 0;
gBattleOutcome = 0;
gBattleControllerExecFlags = 0;
gPaydayMoney = 0;
@ -3030,8 +3028,6 @@ static void BattleStartClearSetData(void)
gPauseCounterBattle = 0;
gBattleMoveDamage = 0;
gIntroSlideFlags = 0;
gBattleScripting.animTurn = 0;
gBattleScripting.animTargetsHit = 0;
gLeveledUpInBattle = 0;
gAbsentBattlerFlags = 0;
gBattleStruct->runTries = 0;