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 // 需要其他物品的数量