Fix GetSpeciesPreEvolution triggering assertf with disabled species (#9455)

Co-authored-by: Hedara <hedara90@gmail.com>
This commit is contained in:
hedara90 2026-03-07 12:14:40 +01:00 committed by GitHub
parent 012a63608f
commit 4d9580ffbb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7233,7 +7233,7 @@ u16 GetSpeciesPreEvolution(u16 species)
for (j = 0; evolutions[j].method != EVOLUTIONS_END; j++)
{
if (SanitizeSpeciesId(evolutions[j].targetSpecies) == species)
if (IsSpeciesEnabled(evolutions[j].targetSpecies) && SanitizeSpeciesId(evolutions[j].targetSpecies) == species)
return i;
}
}