diff --git a/modules/user/model_user.go b/modules/user/model_user.go index 8a52b8eee..e4e44003f 100644 --- a/modules/user/model_user.go +++ b/modules/user/model_user.go @@ -223,7 +223,11 @@ func (this *ModelUser) computeLevel(change *pb.UserResChangedPush) (lvchange boo res int64 ) rewards = make([]*cfg.Gameatn, 0) - for nextLvConf = this.module.configure.GetPlayerlvConf(curLv + 1); nextLvConf != nil; { + for { + nextLvConf = this.module.configure.GetPlayerlvConf(curLv + 1) + if nextLvConf != nil { + break + } if curExp >= int64(nextLvConf.Exp) { curExp = curExp - int64(nextLvConf.Exp) curLv++