diff --git a/src/Corporation/corporate-divisionBase.js b/src/Corporation/corporate-divisionBase.js index 9239a9a4297959f00236e7d3d881a1aa4c393a81..de161794bec99286320e9b4d6431206666b068de 100644 --- a/src/Corporation/corporate-divisionBase.js +++ b/src/Corporation/corporate-divisionBase.js @@ -41,7 +41,7 @@ App.Corporate.Init_DivisionBase = function(shared) { set developmentCount(value) { if(value < 0) { throw "Cannot set development count to less than 0"; } // dissolve is the only function that sets founded to false. - if(value == 0 && this.founded) { throw "Cannot set development count to 0; use dissolve instead."; } + if(value === 0 && this.founded) { throw "Cannot set development count to 0; use dissolve instead."; } this.setStored("Dev", value); } @@ -150,13 +150,12 @@ App.Corporate.Init_DivisionBase = function(shared) { // Unless otherwise specified, divisions don't produce revenue directly. } endWeek_Transfer(divLedger) { - let transferRetval = {total:0}; let divisions = []; for(let otherDiv of this.relatedDivisions.to.filter(div=> div.founded && this.getAutoSendToDivision(div))) { const otherLedger = divLedger.weekLedger.getDivision(otherDiv); const room = otherDiv.availableRoom - otherLedger.transfer.in; - if(room == 0) { continue; } + if(room === 0) { continue; } divisions.push({division: otherDiv, room}); } const fillDivisions = evenFillArray(divisions, this.heldSlaves, pair=>pair.room); diff --git a/src/Corporation/corporate.js b/src/Corporation/corporate.js index 9c35f74a7003e7431e0457ce7ea8c97819cc0c12..d2d6a93ba1ae688b4cc561d6ce9494c76a0ffaf8 100644 --- a/src/Corporation/corporate.js +++ b/src/Corporation/corporate.js @@ -264,7 +264,7 @@ App.Corporate.Init = function() { super(); this._const.category = App.Corporate.maintenance.divisionCategories[categoryId]; - if(this._const.category == null) { throw new "Invalid category id: " + categoryId; } + if(this._const.category == null) { throw "Invalid category id: " + categoryId; } this._var.divisions = []; } addDivision(division) { @@ -397,7 +397,7 @@ App.Corporate.Init = function() { SellUnhousedSlaves: function(division, divLedger, rate) { if(divLedger.market.sell != 0) { return; } - let housing = 2 * rate * division.developmentCount; + let housing = Math.trunc(2 * rate * division.developmentCount); let unhoused = division.heldSlaves - housing; if(unhoused <= 0) { return; }