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;