From 1b8793179483f9fb5135fbdde57f99c253ab36a6 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Tue, 27 Jun 2023 14:30:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=93=E5=8A=9B=E8=BD=AC?= =?UTF-8?q?=E7=BB=8F=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/user/module.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/modules/user/module.go b/modules/user/module.go index 7265de994..29c563519 100644 --- a/modules/user/module.go +++ b/modules/user/module.go @@ -1144,26 +1144,15 @@ func (this *User) ConsumePsAddExp(session comm.IUserSession, ps int32) (addExp i return } - var ( - user *pb.DBUser - ) - if user = this.GetUser(session.GetUserId()); user == nil { - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_UserNofound, - Title: pb.ErrorCode_UserNofound.ToString(), - } - return - } ggd := this.ModuleTools.GetGlobalConf() if ggd == nil { return } //体力消耗,增加玩家经验 addExp = ps * ggd.FightPs - user.Exp += int64(addExp) attrs := make(map[string]int32, 0) - attrs["exp"] = int32(user.Exp) + attrs["exp"] = addExp return addExp, this.AddAttributeValues(session, attrs, true) }