1
This commit is contained in:
parent
6d7805223f
commit
de8af0c10f
@ -299,21 +299,21 @@ void MatchTeam::SyncMatchInfo()
|
||||
void MatchTeam::TryCombineTeam()
|
||||
{
|
||||
if (HaveEmptySlot()) {
|
||||
MatchTeam* matched_team = nullptr;
|
||||
std::shared_ptr<MatchTeam> matched_team;
|
||||
MatchMgr::Instance()->TraverseTeam
|
||||
(
|
||||
[this, &matched_team] (MatchTeam* team, bool& stop)
|
||||
[this, &matched_team] (std::shared_ptr<MatchTeam>& team, bool& stop)
|
||||
{
|
||||
if (team == this) {
|
||||
if (team.get() == this) {
|
||||
return;
|
||||
}
|
||||
if (CanCombine(team)) {
|
||||
if (CanCombine(team.get())) {
|
||||
matched_team = team;
|
||||
stop = true;
|
||||
}
|
||||
});
|
||||
if (matched_team) {
|
||||
Combine(matched_team);
|
||||
Combine(matched_team.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -638,7 +638,7 @@ void MatchTeam::StartGame()
|
||||
auto cb =
|
||||
[team_uuid] (std::vector<std::shared_ptr<BattleDataContext>>& results)
|
||||
{
|
||||
MatchTeam* team = MatchMgr::Instance()->GetTeam(team_uuid);
|
||||
auto team = MatchMgr::Instance()->GetTeam(team_uuid);
|
||||
if (team) {
|
||||
for (auto context : results) {
|
||||
bool found = false;
|
||||
@ -656,7 +656,7 @@ void MatchTeam::StartGame()
|
||||
abort();
|
||||
}
|
||||
}
|
||||
RoomMgr::Instance()->JoinTeam(team);
|
||||
RoomMgr::Instance()->JoinTeam(team.get());
|
||||
team->RemoveTeam();
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user