From b20be661750c0437ad345d9e4eac533128341d11 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Wed, 17 Jan 2024 13:08:34 -0300 Subject: [PATCH] Max Soup ban now checks for mythicals instead of array (#4017) * Removed sGigantaxFactorLockedSpecies to instead check for mythicals * Applied review comments --------- Co-authored-by: Bassoonian --- src/script_pokemon_util.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/script_pokemon_util.c b/src/script_pokemon_util.c index 2f3c29f2a7..ed27236e0a 100644 --- a/src/script_pokemon_util.c +++ b/src/script_pokemon_util.c @@ -308,16 +308,9 @@ void HasGigantamaxFactor(struct ScriptContext *ctx) gSpecialVar_Result = FALSE; } -static const u16 sGigantaxFactorLockedSpecies[] = -{ - SPECIES_MELMETAL, -}; - void ToggleGigantamaxFactor(struct ScriptContext *ctx) { - u32 i; u32 partyIndex = VarGet(ScriptReadHalfword(ctx)); - u32 species; gSpecialVar_Result = FALSE; @@ -325,12 +318,8 @@ void ToggleGigantamaxFactor(struct ScriptContext *ctx) { bool32 gigantamaxFactor; - species = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPECIES); - for (i = 0; i < ARRAY_COUNT(sGigantaxFactorLockedSpecies); i++) - { - if (species == sGigantaxFactorLockedSpecies[i]) - return; - } + if (gSpeciesInfo[SanitizeSpeciesId(GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPECIES))].isMythical) + return; gigantamaxFactor = GetMonData(&gPlayerParty[partyIndex], MON_DATA_GIGANTAMAX_FACTOR); gigantamaxFactor = !gigantamaxFactor;