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
commit 2ca7439ff2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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();