Skip to content

Commit

Permalink
Merge pull request #1066 from solaris-games/fix/scheduled-bulk-upgrad…
Browse files Browse the repository at this point in the history
…e-percentage2

Fix
  • Loading branch information
SpacialCircumstances authored Jul 5, 2024
2 parents 5c99150 + 60a2ee6 commit 169a6f6
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 169a6f6

Please sign in to comment.