上传天赋处理

This commit is contained in:
liwei1dao 2024-02-28 18:40:47 +08:00
parent f8aa29d103
commit dd0e4ed581
2 changed files with 7 additions and 2 deletions

View File

@ -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
}

View File

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