From 97c7d1d5e8adb27e10cafb605ecaea2cc81eb264 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 21 Apr 2020 09:54:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8C=B9=E9=85=8D=E8=A7=84?= =?UTF-8?q?=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/gameserver/roommgr.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/gameserver/roommgr.cc b/server/gameserver/roommgr.cc index 23736cb..0827f9d 100644 --- a/server/gameserver/roommgr.cc +++ b/server/gameserver/roommgr.cc @@ -166,10 +166,16 @@ Room* RoomMgr::GetJoinableRoom(const cs::CMJoin& msg, const RoomType_e self_room } } for (int i = 0; i < RT_Max; ++i) { - if (i != self_room_type) { + if (RoomNum() > ROOM_NUM_DOWN_LIMIT - 5) { for (Room* room : group_rooms[i]) { return room; } + } else { + if (i != self_room_type) { + for (Room* room : group_rooms[i]) { + return room; + } + } } } return nullptr;