Skip to content

Commit

Permalink
fix ABILITYEFFECT_ON_TERRAIN battler Id settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ghoulslash committed Feb 28, 2023
1 parent 5a740c7 commit b399d1e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/battle_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -6230,7 +6230,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
}
break;
case ABILITYEFFECT_ON_TERRAIN: // For ability effects that activate when the field terrain changes.
battler = gBattlerAbility = gBattleScripting.battler;
gLastUsedAbility = GetBattlerAbility(battler);
switch (gLastUsedAbility)
{
Expand All @@ -6239,6 +6238,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
{
gSpecialStatuses[battler].terrainAbilityDone = TRUE;
ChangeTypeBasedOnTerrain(battler);
gBattlerAbility = gBattleScripting.battler = battler;
BattleScriptPushCursorAndCallback(BattleScript_MimicryActivates_End3);
effect++;
}
Expand All @@ -6247,6 +6247,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
if (!gSpecialStatuses[battler].terrainAbilityDone && IsBattlerTerrainAffected(battler, STATUS_FIELD_ELECTRIC_TERRAIN))
{
gSpecialStatuses[battler].terrainAbilityDone = TRUE;
gBattlerAbility = gBattleScripting.battler = battler;
PREPARE_STAT_BUFFER(gBattleTextBuff1, GetHighestStatId(battler));
BattleScriptPushCursorAndCallback(BattleScript_QuarkDriveActivates);
effect++;
Expand Down

0 comments on commit b399d1e

Please sign in to comment.