From 702ac190dae9a8a017a0bac663f77e44d25d76d8 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sat, 2 Mar 2024 09:46:08 -0500 Subject: [PATCH] Don't fail to load save if somehow a move is null --- src/data/egg-moves.ts | 2 +- src/data/pokemon-species.ts | 4 ++-- src/system/pokemon-data.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/data/egg-moves.ts b/src/data/egg-moves.ts index 1e8870ed3..8ef84e96d 100644 --- a/src/data/egg-moves.ts +++ b/src/data/egg-moves.ts @@ -450,7 +450,7 @@ export const speciesEggMoves = { [Species.FALINKS]: [ Moves.POPULATION_BOMB, Moves.BEAT_UP, Moves.SPIKY_SHIELD, Moves.COLLISION_COURSE ], [Species.PINCURCHIN]: [ Moves.SPIKY_SHIELD, Moves.EARTH_POWER, Moves.TOXIC, Moves.BANEFUL_BUNKER ], [Species.SNOM]: [ Moves.FLASH_CANNON, Moves.NASTY_PLOT, Moves.EARTH_POWER, Moves.SURF ], - [Species.STONJOURNER]: [ Moves.BODY_PRESS, Moves.WONDER_ROOM, Moves.AQUA_STEP, Moves.THUNDEROUS_KICK ], + [Species.STONJOURNER]: [ Moves.BODY_PRESS, Moves.WONDER_ROOM, Moves.ANCIENT_POWER, Moves.THUNDEROUS_KICK ], [Species.EISCUE]: [ Moves.TRIPLE_AXEL, Moves.WAVE_CRASH, Moves.LOW_KICK, Moves.SHELL_SMASH ], [Species.INDEEDEE]: [ Moves.LIFE_DEW, Moves.HORN_LEECH, Moves.MOONBLAST, Moves.SPOTLIGHT ], [Species.MORPEKO]: [ Moves.CLOSE_COMBAT, Moves.MILK_DRINK, Moves.TEMPER_FLARE, Moves.DOUBLE_SHOCK ], diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index db9f81634..20d6b5949 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -1861,11 +1861,11 @@ export function initSpecies() { new PokemonForm("Dawn Wings", "dawn-wings", Type.PSYCHIC, Type.GHOST, 4.2, 350, Abilities.PRISM_ARMOR, Abilities.NONE, Abilities.NONE, 680, 97, 113, 109, 157, 127, 77, 255, 0, 300), new PokemonForm("Ultra", "ultra", Type.PSYCHIC, Type.DRAGON, 7.5, 230, Abilities.NEUROFORCE, Abilities.NONE, Abilities.NONE, 754, 97, 167, 97, 167, 97, 129, 255, 0, 300), ), - new PokemonSpecies(Species.MAGEARNA, "Magearna", 7, true, false, true, "Artificial Pokémon", Type.STEEL, Type.FAIRY, 1, 80.5, Abilities.SOUL_HEART, Abilities.NONE, Abilities.NONE, 600, 80, 95, 115, 130, 115, 65, 3, 0, 300, GrowthRate.SLOW, null, false, false, + new PokemonSpecies(Species.MAGEARNA, "Magearna", 7, false, false, true, "Artificial Pokémon", Type.STEEL, Type.FAIRY, 1, 80.5, Abilities.SOUL_HEART, Abilities.NONE, Abilities.NONE, 600, 80, 95, 115, 130, 115, 65, 3, 0, 300, GrowthRate.SLOW, null, false, false, new PokemonForm("Normal", "", Type.STEEL, Type.FAIRY, 1, 80.5, Abilities.SOUL_HEART, Abilities.NONE, Abilities.NONE, 600, 80, 95, 115, 130, 115, 65, 3, 0, 300), new PokemonForm("Original", "original", Type.STEEL, Type.FAIRY, 1, 80.5, Abilities.SOUL_HEART, Abilities.NONE, Abilities.NONE, 600, 80, 95, 115, 130, 115, 65, 3, 0, 300), ), - new PokemonSpecies(Species.MARSHADOW, "Marshadow", 7, true, false, true, "Gloomdweller Pokémon", Type.FIGHTING, Type.GHOST, 0.7, 22.2, Abilities.TECHNICIAN, Abilities.NONE, Abilities.NONE, 600, 90, 125, 80, 90, 90, 125, 3, 0, 300, GrowthRate.SLOW, null, false, true, + new PokemonSpecies(Species.MARSHADOW, "Marshadow", 7, false, false, true, "Gloomdweller Pokémon", Type.FIGHTING, Type.GHOST, 0.7, 22.2, Abilities.TECHNICIAN, Abilities.NONE, Abilities.NONE, 600, 90, 125, 80, 90, 90, 125, 3, 0, 300, GrowthRate.SLOW, null, false, true, new PokemonForm("Normal", "", Type.FIGHTING, Type.GHOST, 0.7, 22.2, Abilities.TECHNICIAN, Abilities.NONE, Abilities.NONE, 600, 90, 125, 80, 90, 90, 125, 3, 0, 300), new PokemonForm("Zenith", "zenith", Type.FIGHTING, Type.GHOST, 0.7, 22.2, Abilities.TECHNICIAN, Abilities.NONE, Abilities.NONE, 600, 90, 125, 80, 90, 90, 125, 3, 0, 300) ), diff --git a/src/system/pokemon-data.ts b/src/system/pokemon-data.ts index ff63237e8..4b20f9b6b 100644 --- a/src/system/pokemon-data.ts +++ b/src/system/pokemon-data.ts @@ -86,7 +86,7 @@ export default class PokemonData { this.summonData = sourcePokemon.summonData; } } else { - this.moveset = source.moveset.map((m: any) => new PokemonMove(m.moveId, m.ppUsed, m.ppUp)); + this.moveset = source.moveset.filter(m => m).map((m: any) => new PokemonMove(m.moveId, m.ppUsed, m.ppUp)); if (!forHistory) { this.status = source.status ? new Status(source.status.effect, source.status.turnCount, source.status.cureTurn)