Skip to content

Commit

Permalink
Fix side effects of bulk upgrade report causing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
SpacialCircumstances committed Jun 26, 2024
1 parent e777321 commit b0b9e4d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions server/services/scheduleBuy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ export default class ScheduleBuyService extends EventEmitter {
// When players schedule actions to spend more credits than they have, we spend all their credits
action.amount = player.credits
}
const report = await this.starUpgradeService.generateUpgradeBulkReport(game, player, action.buyType, action.infrastructureType, action.amount);
if (report.cost > player.credits) {
// If the player does not have enough credits, we do not buy anything.
continue;
}

await this.starUpgradeService.upgradeBulk(game, player, action.buyType, action.infrastructureType, action.amount, false);
} catch (e) {
console.error(e)
Expand Down

0 comments on commit b0b9e4d

Please sign in to comment.