mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-13 03:42:18 +02:00
[Bug] Prevent save corruption when loading a pokemonData that has no moves (#6070)
Prevent save corruption when loading a pokemonData that has no moves
This commit is contained in:
parent
115d63d0c5
commit
2fbaca7b5e
@ -105,7 +105,7 @@ export default class PokemonData {
|
|||||||
|
|
||||||
// TODO: Can't we move some of this verification stuff to an upgrade script?
|
// TODO: Can't we move some of this verification stuff to an upgrade script?
|
||||||
this.nature = source.nature ?? Nature.HARDY;
|
this.nature = source.nature ?? Nature.HARDY;
|
||||||
this.moveset = source.moveset.map((m: any) => PokemonMove.loadMove(m));
|
this.moveset = source.moveset?.map((m: any) => PokemonMove.loadMove(m)) ?? [];
|
||||||
this.status = source.status
|
this.status = source.status
|
||||||
? new Status(source.status.effect, source.status.toxicTurnCount, source.status.sleepTurnsRemaining)
|
? new Status(source.status.effect, source.status.toxicTurnCount, source.status.sleepTurnsRemaining)
|
||||||
: null;
|
: null;
|
||||||
|
Loading…
Reference in New Issue
Block a user