This commit is contained in:
aozhiwei 2024-01-30 21:39:17 +08:00
parent a058ce092d
commit de567a9d61

View File

@ -2707,11 +2707,17 @@ int Room::InitWithMobaBattle(long ip_saddr, int socket_handle, std::shared_ptr<c
int Room::InitWithCustomBattle(long ip_saddr, int socket_handle, std::shared_ptr<cs::CMJoin> msg, int Room::InitWithCustomBattle(long ip_saddr, int socket_handle, std::shared_ptr<cs::CMJoin> msg,
std::shared_ptr<CustomBattle> p) std::shared_ptr<CustomBattle> p)
{ {
std::vector<std::shared_ptr<Team>> room_teams;
std::vector<std::shared_ptr<CustomTeam>> teams; std::vector<std::shared_ptr<CustomTeam>> teams;
p->TraverseTeamList p->TraverseTeamList
( (
[&teams] (std::shared_ptr<CustomTeam> team) -> bool [this, &room_teams, &teams] (std::shared_ptr<CustomTeam> team) -> bool
{ {
auto new_team = NewTeam();
new_team->SetInitTeamMemberNum(0);
new_team->SetAutoFill(true);
room_teams.push_back(new_team);
teams.push_back(team);
return true; return true;
}); });
} }