From 791a899eed1a4e34eed30ff80b531a96248f5008 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Mon, 11 Oct 2021 21:29:08 -0400 Subject: [PATCH] fix sand spit + primal weather --- src/battle_util.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index 68e787698..7b0c85078 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -5028,20 +5028,21 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && !gProtectStructs[gBattlerAttacker].confusionSelfDmg && TARGET_TURN_DAMAGED - && !(WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SANDSTORM_ANY) - && TryChangeBattleWeather(battler, ENUM_WEATHER_SANDSTORM, TRUE) - && !(WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_PRIMAL_ANY)) + && !(WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SANDSTORM_ANY)) { - gBattleScripting.battler = gActiveBattler = battler; - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_SandSpitActivates; - effect++; - } - else if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_PRIMAL_ANY) - { - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_BlockedByPrimalWeatherRet; - effect++; + if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_PRIMAL_ANY) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BlockedByPrimalWeatherRet; + effect++; + } + else if (TryChangeBattleWeather(battler, ENUM_WEATHER_SANDSTORM, TRUE)) + { + gBattleScripting.battler = gActiveBattler = battler; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_SandSpitActivates; + effect++; + } } break; case ABILITY_PERISH_BODY: