diff --git a/modules/user/model_user.go b/modules/user/model_user.go index 96e6e8f6a..bc89e4645 100644 --- a/modules/user/model_user.go +++ b/modules/user/model_user.go @@ -267,12 +267,21 @@ func (this *ModelUser) ChangeLevel(event interface{}, next func(event interface{ nextLvConf = this.module.configure.GetPlayerlvConf(curLv + 1) } - // 最大等级经验封顶 - curLvConf := this.module.configure.GetPlayerlvConf(curLv) - if curExp > int64(curLvConf.Exp) { - if nextLvConf == nil { - curExp = int64(curLvConf.Exp) + if nextLvConf == nil { + curLvConf := this.module.configure.GetPlayerlvConf(curLv) + reward := this.module.globalConf.OverexpReward + var gold int32 + if curExp < int64(curLvConf.Exp) { + gold = int32(curExp) * reward + } else { + yu := int32(curExp) - curLvConf.Exp + gold = yu * reward } + + this.module.DispenseRes(ul.session, []*cfg.Gameatn{{A: "attr", T: "gold", N: gold}}, true) + + curExp = int64(curLvConf.Exp) + } // 等级有递增时再更新