dont overwrite gbattlerAttacker in TryChangeBattleTerrain, update BattleScript_ActivateTerrainAbilities loop iterator

This commit is contained in:
ghoulslash 2023-02-27 22:18:42 -05:00
parent 86144c6a53
commit 5a740c7461
2 changed files with 6 additions and 6 deletions

View File

@ -8803,14 +8803,14 @@ BattleScript_ActivateSwitchInAbilities_Increment:
return
BattleScript_ActivateTerrainAbilities:
copybyte sBATTLER, gBattlerAttacker
setbyte gBattlerAttacker, 0
savetarget
setbyte gBattlerTarget, 0
BattleScript_ActivateTerrainAbilities_Loop:
activateterrainchangeabilities BS_ATTACKER
BattleScript_ActivateTerrainAbilities_Increment:
addbyte gBattlerAttacker, 1
jumpifbytenotequal gBattlerAttacker, gBattlersCount, BattleScript_ActivateTerrainAbilities_Loop
copybyte gBattlerAttacker, sBATTLER
addbyte gBattlerTarget, 1
jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_ActivateTerrainAbilities_Loop
restoretarget
return
BattleScript_ElectricSurgeActivates::

View File

@ -4205,7 +4205,7 @@ static bool32 TryChangeBattleTerrain(u32 battler, u32 statusFlag, u8 *timer)
else
*timer = 5;
gBattlerAttacker = gBattleScripting.battler = battler;
gBattleScripting.battler = battler;
return TRUE;
}