From 3b17ce39f7d462fa9a8c5e590a2ccb00a4f7e5de Mon Sep 17 00:00:00 2001 From: skolgrahd <162426316+skolgrahd@users.noreply.github.com> Date: Sat, 13 Apr 2024 13:19:14 -0400 Subject: [PATCH] Fixed softlock w/ weather-triggered form changes & Cloud Nine (#4382) * Fixed softlock when weather-triggered form changes are suppressed by Cloud Nine * Removed KNOWN_FAILING; line from Castform Air Lock test --- src/battle_util.c | 3 ++- test/battle/ability/forecast.c | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index e27049cba536..88ae8af274a1 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -10454,7 +10454,8 @@ u16 GetBattleFormChangeTargetSpecies(u32 battler, u16 method) targetSpecies = formChanges[i].targetSpecies; } // Otherwise, just check for a match between the weather and the form change table. - else if (gBattleWeather & formChanges[i].param1 + // Added a check for whether the weather is in effect to prevent end-of-turn soft locks with Cloud Nine / Air Lock + else if (((gBattleWeather & formChanges[i].param1) && WEATHER_HAS_EFFECT) || (gBattleWeather == B_WEATHER_NONE && formChanges[i].param1 == B_WEATHER_NONE)) { targetSpecies = formChanges[i].targetSpecies; diff --git a/test/battle/ability/forecast.c b/test/battle/ability/forecast.c index df7ecd00a46c..f87e34a532be 100644 --- a/test/battle/ability/forecast.c +++ b/test/battle/ability/forecast.c @@ -266,7 +266,6 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal when Sandstorm i SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal under Air Lock") { - KNOWN_FAILING; GIVEN { PLAYER(SPECIES_CASTFORM_NORMAL) { Ability(ABILITY_FORECAST); } OPPONENT(SPECIES_WOBBUFFET);