From 4c88d9103c8b3033075c49bc3512bf57f6bd0bc9 Mon Sep 17 00:00:00 2001 From: luying Date: Tue, 1 Mar 2022 13:44:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A3=85=E5=A4=87=EF=BC=9A=E6=B6=88=E8=80=97?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/services/rewardService.ts | 2 ++ 1 file changed, 2 insertions(+) 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);