mirror of
https://github.com/rh-hideout/pokeemerald-expansion.git
synced 2026-03-21 18:04:50 -05:00
Add missing clear check for Defog
We usually want to check first before we remove any statuses.
This commit is contained in:
parent
7e0b1de2ae
commit
65a4d852fe
|
|
@ -9392,14 +9392,21 @@ static bool32 TryDefogClear(u32 battlerAtk, bool32 clear)
|
|||
}
|
||||
if (gBattleWeather & B_WEATHER_FOG)
|
||||
{
|
||||
gBattleWeather &= ~B_WEATHER_FOG;
|
||||
BattleScriptCall(BattleScript_FogEnded_Ret);
|
||||
|
||||
if (clear)
|
||||
{
|
||||
gBattleWeather &= ~B_WEATHER_FOG;
|
||||
BattleScriptCall(BattleScript_FogEnded_Ret);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
if (GetConfig(CONFIG_DEFOG_EFFECT_CLEARING) >= GEN_8 && (gFieldStatuses & STATUS_FIELD_TERRAIN_ANY))
|
||||
{
|
||||
RemoveAllTerrains();
|
||||
BattleScriptCall(BattleScript_TerrainEnds_Ret);
|
||||
if (clear)
|
||||
{
|
||||
RemoveAllTerrains();
|
||||
BattleScriptCall(BattleScript_TerrainEnds_Ret);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user