Tolerate & recover from null player money

This commit is contained in:
omuretsu 2022-10-25 14:56:47 -04:00
parent d0820c81ce
commit 8837c01d21

@ -166,7 +166,9 @@ export class PlayerObject extends Person {
/** Initializes a PlayerObject object from a JSON save state. */
static fromJSON(value: IReviverValue): PlayerObject {
return Generic_fromJSON(PlayerObject, value.data);
const player = Generic_fromJSON(PlayerObject, value.data);
if (player.money === null) player.money = 0;
return player;
}
}