Skip to content

Commit

Permalink
* Fixed bulk upgrades producing two entries in the event log.
Browse files Browse the repository at this point in the history
* Fixed bulk upgrades deducting credits twice for the AI when it only acquired the upgrades once.
  • Loading branch information
Metritutus committed Jul 27, 2024
1 parent 28d0976 commit 81c2436
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions server/services/starUpgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -532,15 +532,6 @@ export default class StarUpgradeService extends EventEmitter {
await this.achievementService.incrementInfrastructureBuilt(infrastructureType, player.userId, upgradeSummary.upgraded);
}

player.credits -= upgradeSummary.cost;

this.emit(StarUpgradeServiceEvents.onPlayerInfrastructureBulkUpgraded, {
gameId: game._id,
gameTick: game.state.tick,
player,
upgradeSummary
});

if (infrastructureType === 'science') {
upgradeSummary.currentResearchTicksEta = this.researchService.calculateCurrentResearchETAInTicks(game, player);
upgradeSummary.nextResearchTicksEta = this.researchService.calculateNextResearchETAInTicks(game, player);
Expand Down

0 comments on commit 81c2436

Please sign in to comment.