diff --git a/comm/const.go b/comm/const.go index 0f47ce036..576d9fc3f 100644 --- a/comm/const.go +++ b/comm/const.go @@ -295,6 +295,7 @@ const ( ResFriend = "friendPoint" //友情点 StarCoin = "starcoin" //星座币 SociatyCoin = "guildcoin" //公会币 + ArenaCoin = "arenacoin" //竞技场币 ) const ( Gold int32 = 1 //金币 diff --git a/modules/user/module.go b/modules/user/module.go index 2eac87352..7d2e1bc07 100644 --- a/modules/user/module.go +++ b/modules/user/module.go @@ -326,6 +326,14 @@ func (this *User) change(session comm.IUserSession, attr string, add int32) (cha } } change.Guildcoin += add + case comm.ArenaCoin: + if add < 0 { + if userEx.ArenaCoin+add < 0 { + code = pb.ErrorCode_UserSociatyCoinNoEnough + return + } + } + change.Guildcoin += add default: err = errors.New(fmt.Sprintf("%s no supported", attr)) return