Reset all battler IDs at battle start (#3111)

* reset battler IDs before BattleScript_OverworldTerrain and BattleScript_OverworldWeatherStarts to prevent playanimation from executing on invalid battler ids

* replace BS_SCRIPTING with BS_BATTLER_0 in BattleScript_OverworldTerrain and BattleScript_OverworldWeatherStarts

---------

Co-authored-by: ghoulslash <pokevoyager0@gmail.com>
This commit is contained in:
ghoulslash 2023-08-04 02:57:06 -04:00 committed by GitHub
parent 7d8bcce9a5
commit 4ae6ae4de3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -6793,14 +6793,14 @@ BattleScript_SunlightFaded::
BattleScript_OverworldWeatherStarts::
printfromtable gWeatherStartsStringIds
waitmessage B_WAIT_TIME_LONG
playanimation_var BS_ATTACKER, sB_ANIM_ARG1
playanimation_var BS_BATTLER_0, sB_ANIM_ARG1
call BattleScript_ActivateWeatherAbilities
end3
BattleScript_OverworldTerrain::
printfromtable gTerrainStringIds
waitmessage B_WAIT_TIME_LONG
playanimation BS_SCRIPTING, B_ANIM_RESTORE_BG
playanimation BS_BATTLER_0, B_ANIM_RESTORE_BG
call BattleScript_ActivateTerrainEffects
end3

View File

@ -3129,6 +3129,9 @@ static void BattleStartClearSetData(void)
gBattlerAttacker = 0;
gBattlerTarget = 0;
gEffectBattler = 0;
gBattleScripting.battler = 0;
gBattlerAbility = 0;
gBattleWeather = 0;
gHitMarker = 0;