Merge pull request #179 from danielyxie/dev

Fixed a serious bug with Corporation profit (forgot to multiple by se…
This commit is contained in:
danielyxie
2018-01-27 12:43:32 -06:00
committed by GitHub
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -41917,7 +41917,9 @@ Corporation.prototype.process = function(numCycles=1) {
this.revenue = this.revenue.plus(ind.lastCycleRevenue);
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.state.nextState();
+3 -1
View File
@@ -2630,7 +2630,9 @@ Corporation.prototype.process = function(numCycles=1) {
this.revenue = this.revenue.plus(ind.lastCycleRevenue);
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.state.nextState();