mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-18 23:38:35 +02:00
Fix broken HP
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user