Fix broken HP

This commit is contained in:
omuretsu
2023-01-03 02:13:01 -05:00
parent 7021b905b7
commit 7c6d7206dd
3 changed files with 9 additions and 9 deletions

View File

@@ -165,6 +165,7 @@ export class PlayerObject extends Person implements IPlayer {
/** Initializes a PlayerObject object from a JSON save state. */
static fromJSON(value: IReviverValue): PlayerObject {
if (!value.data.hp?.current || !value.data.hp?.max) value.data.hp = { current: 10, max: 10 };
const player = Generic_fromJSON(PlayerObject, value.data);
if (player.money === null) player.money = 0;
return player;