[Bug] Prevent some corrupt eggs from crashing the game (#5787)

If an egg is somehow a species that doesn't have an associated egg tier
(such as Pikachu), `Egg#getEggTier` now falls back to `EggTier.COMMON`
This commit is contained in:
NightKev 2025-05-07 21:01:54 -07:00 committed by GitHub
parent 5ba294ffee
commit fa6c51d1e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -598,7 +598,7 @@ export class Egg {
}
private getEggTier(): EggTier {
return speciesEggTiers[this.species];
return speciesEggTiers[this.species] ?? EggTier.COMMON;
}
////