Fixed a serious bug with Corporation profit (forgot to multiple by secsperCycle

This commit is contained in:
danielyxie 2018-01-27 12:42:53 -06:00
parent f60fe597fb
commit be17cff29e
2 changed files with 6 additions and 2 deletions

4
dist/bundle.js vendored

@ -41917,7 +41917,9 @@ Corporation.prototype.process = function(numCycles=1) {
this.revenue = this.revenue.plus(ind.lastCycleRevenue); this.revenue = this.revenue.plus(ind.lastCycleRevenue);
this.expenses = this.expenses.plus(ind.lastCycleExpenses); this.expenses = this.expenses.plus(ind.lastCycleExpenses);
}); });
this.funds = this.funds.plus(this.revenue.minus(this.expenses)); var profit = this.revenue.minus(this.expenses);
var cycleProfit = profit.times(marketCycles * SecsPerMarketCycle);
this.funds = this.funds.plus(cycleProfit);
this.updateSharePrice(); this.updateSharePrice();
} }
this.state.nextState(); this.state.nextState();

@ -2630,7 +2630,9 @@ Corporation.prototype.process = function(numCycles=1) {
this.revenue = this.revenue.plus(ind.lastCycleRevenue); this.revenue = this.revenue.plus(ind.lastCycleRevenue);
this.expenses = this.expenses.plus(ind.lastCycleExpenses); this.expenses = this.expenses.plus(ind.lastCycleExpenses);
}); });
this.funds = this.funds.plus(this.revenue.minus(this.expenses)); var profit = this.revenue.minus(this.expenses);
var cycleProfit = profit.times(marketCycles * SecsPerMarketCycle);
this.funds = this.funds.plus(cycleProfit);
this.updateSharePrice(); this.updateSharePrice();
} }
this.state.nextState(); this.state.nextState();