diff --git a/modules/modulebase.go b/modules/modulebase.go index 5fd9f5444..6bfdfd2d4 100644 --- a/modules/modulebase.go +++ b/modules/modulebase.go @@ -743,7 +743,7 @@ func (this *ModuleBase) FormatRes(res []*cfg.Gameatn) (ret []*cfg.Gameatn) { } } for k, v := range attrs { - if v >= 0 { + if v > 0 { ret = append(ret, &cfg.Gameatn{ A: "attr", T: k, @@ -753,7 +753,7 @@ func (this *ModuleBase) FormatRes(res []*cfg.Gameatn) (ret []*cfg.Gameatn) { } for k, v := range items { - if v >= 0 { + if v > 0 { ret = append(ret, &cfg.Gameatn{ A: "item", T: k, diff --git a/modules/smithy/api_forgeequip.go b/modules/smithy/api_forgeequip.go index 53fad041b..27d40c12f 100644 --- a/modules/smithy/api_forgeequip.go +++ b/modules/smithy/api_forgeequip.go @@ -79,21 +79,27 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq } // 是否是精益打造 if req.Quality > 0 { - costRes = append(costRes, reelcfg.RefineCos...) + if len(reelcfg.RefineCos) > 0 { + costRes = append(costRes, reelcfg.RefineCos...) + } bQuality = true } // 校验是不是装备定制打造 if req.SuiteId != 0 { if req.Position == -1 { - if errdata = this.module.CheckRes(session, reelcfg.CustomizedCos1); errdata != nil { - return + if len(reelcfg.CustomizedCos1) > 0 { + if errdata = this.module.CheckRes(session, reelcfg.CustomizedCos1); errdata != nil { + return + } + costRes = append(costRes, reelcfg.CustomizedCos1...) } - costRes = append(costRes, reelcfg.CustomizedCos1...) } else { - if errdata = this.module.CheckRes(session, reelcfg.CustomizedCos2); errdata != nil { - return + if len(reelcfg.CustomizedCos2) > 0 { + if errdata = this.module.CheckRes(session, reelcfg.CustomizedCos2); errdata != nil { + return + } + costRes = append(costRes, reelcfg.CustomizedCos2...) } - costRes = append(costRes, reelcfg.CustomizedCos2...) } // 随机权重 获取等级 index := this.module.modelStove.GetRandEquipLv(reelcfg.CustomizedLvDistribution)