Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SpacialCircumstances committed Jul 5, 2024
1 parent 5c99150 commit 60a2ee6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/services/scheduleBuy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ export default class ScheduleBuyService extends EventEmitter {
for (let action of percentageActions) {
const percentageToCredits = Math.floor((action.amount / Math.max(totalPercentage, 100)) * player.credits);

const report = await this.starUpgradeService.generateUpgradeBulkReport(game, player, action.buyType, action.infrastructureType, percentageToCredits);
// pass as total credits since percentage was already calculated
const report = await this.starUpgradeService.generateUpgradeBulkReport(game, player, 'totalCredits', action.infrastructureType, percentageToCredits);

if (report.cost > player.credits) {
continue;
Expand Down

0 comments on commit 60a2ee6

Please sign in to comment.