From 8d3acd80bd936bc74201a90716c83d4b12a30f90 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Thu, 1 Jun 2023 15:41:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E8=80=97=E6=95=B4=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/hero/api_strengthenUpSkill.go | 11 ++++++++--- modules/hero/configure_comp.go | 5 +++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/modules/hero/api_strengthenUpSkill.go b/modules/hero/api_strengthenUpSkill.go index 20b36a8cb..cdbb04adc 100644 --- a/modules/hero/api_strengthenUpSkill.go +++ b/modules/hero/api_strengthenUpSkill.go @@ -54,10 +54,15 @@ func (this *apiComp) StrengthenUpSkill(session comm.IUserSession, req *pb.HeroSt } } // 消耗获取 - for i := 0; i < int(lvUpCount); i++ { - if atn := this.module.configure.GetHeroSkillCost(heroCfg.Star); len(atn) > 0 { - cost = append(cost, atn...) + + atn := this.module.configure.GetHeroSkillCost(heroCfg.Star) + for _, v := range atn { + res := &cfg.Gameatn{ + A: v.A, + T: v.T, + N: v.N * lvUpCount, } + cost = append(cost, res) } // 检查消耗 diff --git a/modules/hero/configure_comp.go b/modules/hero/configure_comp.go index 0ca61e03f..096d5581e 100644 --- a/modules/hero/configure_comp.go +++ b/modules/hero/configure_comp.go @@ -256,8 +256,9 @@ func (this *configureComp) GetHeroSkillUpConfig(skillid int32) (data *cfg.GameHe var ( v interface{} ) - if conf, ok := v.(*cfg.GameHeroSkillLevel); ok { - if v, err = this.GetConfigure(hero_skillup); err == nil { + + if v, err = this.GetConfigure(hero_skillup); err == nil { + if conf, ok := v.(*cfg.GameHeroSkillLevel); ok { if data = conf.Get(skillid); data == nil { err = comm.NewNotFoundConfErr("hero", hero_skillup, skillid) }