This commit is contained in:
aozhiwei 2024-02-02 16:08:18 +08:00
parent 99dfdb022a
commit 734c4d958c

View File

@ -1092,14 +1092,18 @@ bool Room::CanJoin(const std::string& accountid,
GetHumanNum() >= GetRoomMaxPlayerNum()
) {
bool have_team = false;
for (auto& pair : human_hash_) {
if (pair.second->team_uuid == msg.team_uuid()) {
if (pair.second->GetTeam() && !pair.second->GetTeam()->IsFull()) {
have_team = true;
break;
}
}
}//end for human_hash_
TraverseHumanList
(
[&have_team, &msg] (Human* ele_hum) -> bool
{
if (ele_hum->team_uuid == msg.team_uuid()) {
if (ele_hum->GetTeam() && !ele_hum->GetTeam()->IsFull()) {
have_team = true;
return false;
}
}
return true;
});
if (have_team) {
while (GetHumanNum() >= GetRoomMaxPlayerNum()) {
RandRemoveAndroid();