diff --git a/modules/pvp/module.go b/modules/pvp/module.go index a38ec7c83..e7c110739 100644 --- a/modules/pvp/module.go +++ b/modules/pvp/module.go @@ -87,11 +87,13 @@ func (this *Pvp) CreatePvp(red, blue *pb.PvpUserInfo, ptype pb.PvpType) (battleI // readytimer: timewheel.Add(time.Second*60, this.readyTimeOut, battleId), } - if battle.RedSession, ok = this.GetUserSession(red.Uid); ok { + if battle.RedSession, ok = this.GetUserSession(red.Uid); !ok { code = pb.ErrorCode_BattleUserOff + return } - if battle.BlueSession, ok = this.GetUserSession(blue.Uid); ok { + if battle.BlueSession, ok = this.GetUserSession(blue.Uid); !ok { code = pb.ErrorCode_BattleUserOff + return } this.lock.Lock() this.battles[battle.Id] = battle