diff --git a/devNotes/twine JS.txt b/devNotes/twine JS.txt index 4e5c393eac6d5c9c57604534f8f3672e72951c41..cab476276c2a672dc48bf990bd55463519ef218f 100644 --- a/devNotes/twine JS.txt +++ b/devNotes/twine JS.txt @@ -3117,11 +3117,11 @@ window.cashX = function(cost, what, who) { `; } else { + //Spend the money + V.cash += cost; + //INCOME if(cost > 0) { - - //Spend the money - V.cash += cost; //record the action if (typeof V.lastWeeksCashIncome[what] !== 'undefined') { @@ -3140,9 +3140,6 @@ window.cashX = function(cost, what, who) { //EXPENSES else if(cost < 0) { - //Spend the money - V.cash += cost; - //record the action if (typeof V.lastWeeksCashExpenses[what] !== 'undefined') { V.lastWeeksCashExpenses[what] += cost; @@ -3159,9 +3156,6 @@ window.cashX = function(cost, what, who) { } } } - else { - //somebody probably tried to pass a 0, ignore it. New slaves will default to "slaveCost: 0", no need to call a costX for it. - } return cost; } }; diff --git a/src/js/economyJS.tw b/src/js/economyJS.tw index d54156cd24c37d403fb6a4cfa4b5d8636352ca0f..8ac5d2cab7d906b841af64276c7689c0068ccd58 100644 --- a/src/js/economyJS.tw +++ b/src/js/economyJS.tw @@ -973,11 +973,11 @@ window.cashX = function(cost, what, who) { `; } else { + //Spend the money + V.cash += cost; + //INCOME if(cost > 0) { - - //Spend the money - V.cash += cost; //record the action if (typeof V.lastWeeksCashIncome[what] !== 'undefined') { @@ -996,9 +996,6 @@ window.cashX = function(cost, what, who) { //EXPENSES else if(cost < 0) { - //Spend the money - V.cash += cost; - //record the action if (typeof V.lastWeeksCashExpenses[what] !== 'undefined') { V.lastWeeksCashExpenses[what] += cost; @@ -1015,9 +1012,6 @@ window.cashX = function(cost, what, who) { } } } - else { - //somebody probably tried to pass a 0, ignore it. New slaves will default to "slaveCost: 0", no need to call a costX for it. - } return cost; } };