diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index e8b751777bd1..f8e24cb91ac7 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -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:: diff --git a/src/battle_util.c b/src/battle_util.c index 1625ff919c3f..fc30547e6079 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -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; }