From 60a2ee672f7a8d09ee430d16f7dae9c4714c039d Mon Sep 17 00:00:00 2001 From: SpacialCircumstances Date: Fri, 5 Jul 2024 13:47:23 +0200 Subject: [PATCH] Fix --- server/services/scheduleBuy.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/services/scheduleBuy.ts b/server/services/scheduleBuy.ts index ded71063c..1c96d21cc 100644 --- a/server/services/scheduleBuy.ts +++ b/server/services/scheduleBuy.ts @@ -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;