mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-26 08:46:55 +00:00
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);
|
const allEvolvingPokemon = Object.keys(pokemonEvolutions);
|
||||||
for (const p of allEvolvingPokemon) {
|
for (const p of allEvolvingPokemon) {
|
||||||
for (const e of pokemonEvolutions[p]) {
|
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 speciesId = parseInt(p) as Species;
|
||||||
const level = e.level;
|
const level = e.level;
|
||||||
prevolutionLevels.push([ speciesId, level ]);
|
prevolutionLevels.push([ speciesId, level ]);
|
||||||
|
Loading…
Reference in New Issue
Block a user