mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-10 09:43:54 +01:00
Tolerate & recover from null player money
This commit is contained in:
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user