Merge pull request #4019 from MageKing17/patch-4

API: All the player sub-objects need to be copied for `getPlayer`.
This commit is contained in:
hydroflame 2022-08-23 12:07:34 -03:00 committed by GitHub
commit ed76c5e15d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1911,10 +1911,9 @@ const base: InternalAPI<NS> = {
}, },
getPlayer: () => (): INetscriptPlayer => { getPlayer: () => (): INetscriptPlayer => {
const data = { const data = {
hp: Player.hp, hp: JSON.parse(JSON.stringify(Player.hp)),
skills: Player.skills, skills: JSON.parse(JSON.stringify(Player.skills)),
exp: Player.exp, exp: JSON.parse(JSON.stringify(Player.exp)),
hacking_chance_mult: Player.mults.hacking_chance,
mults: JSON.parse(JSON.stringify(Player.mults)), mults: JSON.parse(JSON.stringify(Player.mults)),
numPeopleKilled: Player.numPeopleKilled, numPeopleKilled: Player.numPeopleKilled,
money: Player.money, money: Player.money,