diff --git a/src/js/economyJS.js b/src/js/economyJS.js index 3b520bae0e84b9b2b8219c3a4a4b6c8d289f72ed..ab6cc26a67e97010db967fd8a1b844051689f5e8 100644 --- a/src/js/economyJS.js +++ b/src/js/economyJS.js @@ -2299,7 +2299,7 @@ globalThis.cashX = function(cost, what, who) { } // record the slave, if available - if (typeof who !== 'undefined') { + if (typeof who !== 'undefined' && who.ID !== -1) { who.lastWeeksCashIncome += cost; who.lifetimeCashIncome += cost; } @@ -2323,7 +2323,7 @@ globalThis.cashX = function(cost, what, who) { } // record the slave, if available - if (typeof who !== 'undefined') { + if (typeof who !== 'undefined' && who.ID !== -1) { if (what === "slaveTransfer") { who.slaveCost = cost; } else { @@ -2362,7 +2362,7 @@ globalThis.repX = function(rep, what, who) { // These are all scaled relative to current rep except when recording the who, to keep comparisons between slaves possible across times. This quite drastically reduces rep income at high levels of rep and only slightly at low levels. if (rep > 0) { // record the slave, if available - if (typeof who !== 'undefined') { + if (typeof who !== 'undefined' && who.ID !== -1) { who.lastWeeksRepIncome += rep; who.lifetimeRepIncome += rep; } @@ -2386,7 +2386,7 @@ globalThis.repX = function(rep, what, who) { } // record the slave, if available - if (typeof who !== 'undefined') { + if (typeof who !== 'undefined' && who.ID !== -1) { who.lastWeeksRepExpenses += rep; who.lifetimeRepExpenses += rep; }