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 {