From dd0e4ed5812d6f77524e681f9ea579a4abc137b5 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Wed, 28 Feb 2024 18:40:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=A4=A9=E8=B5=8B=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/exclusive/api_addexp.go | 7 ++++++- modules/hero/api_talentlearn.go | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/exclusive/api_addexp.go b/modules/exclusive/api_addexp.go index afcc7532d..556f719fd 100644 --- a/modules/exclusive/api_addexp.go +++ b/modules/exclusive/api_addexp.go @@ -75,8 +75,13 @@ func (this *apiComp) AddExp(session comm.IUserSession, req *pb.ExclusiveAddExpRe info.Exp = lvconf.Needexp break } - if lvconf.Needexp < info.Exp { + if lvconf.Needexp <= info.Exp { info.Lv++ + info.Exp -= lvconf.Needexp + info.Property = make(map[int32]int32) + for _, v := range lvconf.Attribute { + info.Property[v.A] = v.N + } } else { break } diff --git a/modules/hero/api_talentlearn.go b/modules/hero/api_talentlearn.go index 8b5ebe128..0590f8ff3 100644 --- a/modules/hero/api_talentlearn.go +++ b/modules/hero/api_talentlearn.go @@ -133,7 +133,7 @@ func (this *apiComp) TalentLearn(session comm.IUserSession, req *pb.HeroTalentLe res = append(res, talentConf.Thing...) // 消耗指定的天赋点数 t, err := this.module.configure.GetHeroTalentBoxItem(talent.HeroId) - if err != nil && talentConf.Point > 0 { + if err == nil { curItemCount := int32(this.module.ModuleItems.QueryItemAmount(session.GetUserId(), t)) if curItemCount < talentConf.Point { // 如果数量不够 则取找其他物品替代 leftCount := talentConf.Point - curItemCount // 需要其他物品的数量