装备:消耗修复

This commit is contained in:
luying
2022-03-01 13:44:57 +08:00
parent 8ba09685a8
commit 4c88d9103c

View File

@@ -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);