Don't fail to load save if somehow a move is null

This commit is contained in:
Flashfyre 2024-03-02 09:46:08 -05:00
parent 96d2813d95
commit 702ac190da
3 changed files with 4 additions and 4 deletions

View File

@ -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 ],

View File

@ -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)
),

View File

@ -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)