From 9d3041954dd99205401b2c3be5d3c7ed9e21a796 Mon Sep 17 00:00:00 2001 From: luying Date: Tue, 7 Jun 2022 15:37:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BB=E6=88=90=EF=BC=9A=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=B6=88=E8=80=97=E6=9D=90=E6=96=99=E4=BC=9A=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=A9=BA=E6=95=B0=E6=8D=AE=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/servers/role/handler/heroHandler.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/game-server/app/servers/role/handler/heroHandler.ts b/game-server/app/servers/role/handler/heroHandler.ts index 872c82c06..b3408c3af 100644 --- a/game-server/app/servers/role/handler/heroHandler.ts +++ b/game-server/app/servers/role/handler/heroHandler.ts @@ -103,9 +103,11 @@ export class HeroHandler { needExp -= dicGoods.value * _count; break; } else { - material.push({ id, count }); - newExp += dicGoods.value * count; - needExp -= dicGoods.value * count; + if(count > 0) { + material.push({ id, count }); + newExp += dicGoods.value * count; + needExp -= dicGoods.value * count; + } } } @@ -599,7 +601,7 @@ export class HeroHandler { if(!hero) return resResult(STATUS.HERO_NOT_FIND); let consumes = hero.consumes||[]; - return resResult(STATUS.SUCCESS, { previewGoods: consumes }); + return resResult(STATUS.SUCCESS, { previewGoods: consumes.filter(consume => consume.count > 0) }); } public async rebirth(msg: { hid: number }, session: BackendSession) {