From cad863345a05067e570acc871ca9700cec4cff46 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Fri, 2 Dec 2022 11:04:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E8=BF=9B=E6=9C=BA=E5=9C=BA?= =?UTF-8?q?=E5=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/user/module.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/user/module.go b/modules/user/module.go index 7d2e1bc07..e6d1a5598 100644 --- a/modules/user/module.go +++ b/modules/user/module.go @@ -267,6 +267,7 @@ func (this *User) change(session comm.IUserSession, attr string, add int32) (cha Friend: userEx.FriendPoint, Starcoin: user.Starcoin, Guildcoin: userEx.SociatyCoin, + ArenaCoin: userEx.ArenaCoin, } switch attr { @@ -329,11 +330,11 @@ func (this *User) change(session comm.IUserSession, attr string, add int32) (cha case comm.ArenaCoin: if add < 0 { if userEx.ArenaCoin+add < 0 { - code = pb.ErrorCode_UserSociatyCoinNoEnough + code = pb.ErrorCode_UserArenaCoinNoEnough return } } - change.Guildcoin += add + change.ArenaCoin += add default: err = errors.New(fmt.Sprintf("%s no supported", attr)) return @@ -352,6 +353,7 @@ func (this *User) change(session comm.IUserSession, attr string, add int32) (cha updateEx := map[string]interface{}{ comm.ResFriend: change.Friend, comm.SociatyCoin: change.Guildcoin, + comm.ArenaCoin: change.ArenaCoin, } if err := this.modelUser.updateUserAttr(uid, update); err != nil {