Prevent duplicate evolutions crashing the game (#1416)
This commit is contained in:
parent
6418632bd3
commit
72c7e9c194
|
@ -736,7 +736,7 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali
|
|||
const allEvolvingPokemon = Object.keys(pokemonEvolutions);
|
||||
for (const p of allEvolvingPokemon) {
|
||||
for (const e of pokemonEvolutions[p]) {
|
||||
if (e.speciesId === this.speciesId && (!this.forms.length || !e.evoFormKey || e.evoFormKey === this.forms[this.formIndex].formKey)) {
|
||||
if (e.speciesId === this.speciesId && (!this.forms.length || !e.evoFormKey || e.evoFormKey === this.forms[this.formIndex].formKey) && prevolutionLevels.every(pe => pe[0] !== parseInt(p))) {
|
||||
const speciesId = parseInt(p) as Species;
|
||||
const level = e.level;
|
||||
prevolutionLevels.push([ speciesId, level ]);
|
||||
|
|
Loading…
Reference in New Issue