From 46d5d3b3fdb109d4cc4713ea976d2ff791e1d03d Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Thu, 23 Feb 2023 09:35:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86=20?= =?UTF-8?q?=E9=98=B2=E6=AD=A2=E4=B8=8D=E6=B6=88=E8=80=97=E8=AF=A5=E9=81=93?= =?UTF-8?q?=E5=85=B7=20=E4=BD=86=E6=98=AF=E6=8A=80=E8=83=BD=E5=81=9A?= =?UTF-8?q?=E4=BA=86=E8=AF=A5=E9=81=93=E5=85=B7=E7=9A=84=E5=87=8F=E5=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/smithy/api_forgeequip.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/smithy/api_forgeequip.go b/modules/smithy/api_forgeequip.go index 499edb194..4b92f4f31 100644 --- a/modules/smithy/api_forgeequip.go +++ b/modules/smithy/api_forgeequip.go @@ -116,8 +116,19 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq } costRes = append(costRes, reelcfg.BasicCos...) - // subAtn := this.module.modelStove.CheckForgeConsume(req.ReelId, stove.Data[req.ReelId].Lv) - // costRes = append(costRes, subAtn...) + subAtn := this.module.modelStove.CheckForgeConsume(req.ReelId, stove.Data[req.ReelId].Lv) + //costRes = append(costRes, subAtn...) + // 异常处理 防止不消耗该道具 但是技能做了该道具的减免 + for _, v := range costRes { + for _, v1 := range subAtn { + if v.A == v1.A && v.T == v1.T { + v.N += v1.N + } + } + if v.N < 0 { + v.N = 0 + } + } if code = this.module.CheckRes(session, costRes); code != pb.ErrorCode_Success { return }