diff --git a/game-server/app/services/rewardService.ts b/game-server/app/services/rewardService.ts index ae1b2712a..8762ac1f6 100644 --- a/game-server/app/services/rewardService.ts +++ b/game-server/app/services/rewardService.ts @@ -96,6 +96,7 @@ export class CheckMeterial { this.pushToNotEnoughItems(this.goldId, goldCost - this.itemsIndb.get(this.goldId)); isEnough = false; } + this.itemsIndb.set(this.goldId, this.itemsIndb.get(this.goldId) - goldCost); } if(isEnough && coin.length > 0) { if(!this.itemsIndb.has(this.coinId)) { @@ -108,6 +109,7 @@ export class CheckMeterial { this.pushToNotEnoughItems(this.coinId, coinCost - this.itemsIndb.get(this.coinId)); isEnough = false; } + this.itemsIndb.set(this.coinId, this.itemsIndb.get(this.coinId) - coinCost); } if(isEnough) this.consumes.push(...goods);