Skip to content

Commit

Permalink
dont overwrite gbattlerAttacker in TryChangeBattleTerrain, update Bat…
Browse files Browse the repository at this point in the history
…tleScript_ActivateTerrainAbilities loop iterator
  • Loading branch information
ghoulslash committed Feb 28, 2023
1 parent 86144c6 commit 5a740c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions data/battle_scripts_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand Down
2 changes: 1 addition & 1 deletion src/battle_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 5a740c7

Please sign in to comment.