修复匹配到5个人问题
This commit is contained in:
parent
724dc3ab72
commit
d984b10cc4
@ -1298,6 +1298,10 @@ void Room::CombineTeam()
|
||||
need_combine_teams_copy.erase(team_id1);
|
||||
} else {
|
||||
pair1.second = new_team_num;
|
||||
if (need_combine_teams_copy.find(pair1.first) !=
|
||||
need_combine_teams_copy.end()) {
|
||||
need_combine_teams_copy[pair1.first] = new_team_num;
|
||||
}
|
||||
}
|
||||
need_combine_teams.erase(team_id2);
|
||||
need_combine_teams_copy.erase(team_id2);
|
||||
@ -1308,6 +1312,10 @@ void Room::CombineTeam()
|
||||
need_combine_teams_copy.erase(team_id1);
|
||||
} else {
|
||||
pair1.second = new_team_num;
|
||||
if (need_combine_teams_copy.find(pair1.first) !=
|
||||
need_combine_teams_copy.end()) {
|
||||
need_combine_teams_copy[pair1.first] = new_team_num;
|
||||
}
|
||||
}
|
||||
need_combine_teams.erase(team_id2);
|
||||
need_combine_teams_copy.erase(team_id2);
|
||||
@ -1317,6 +1325,10 @@ void Room::CombineTeam()
|
||||
need_combine_teams_copy.erase(team_id2);
|
||||
} else {
|
||||
pair2.second = new_team_num;
|
||||
if (need_combine_teams.find(pair2.first) !=
|
||||
need_combine_teams.end()) {
|
||||
need_combine_teams[pair2.first] = new_team_num;
|
||||
}
|
||||
}
|
||||
need_combine_teams.erase(team_id1);
|
||||
need_combine_teams_copy.erase(team_id1);
|
||||
@ -1748,9 +1760,6 @@ void Room::SecondRandPoint()
|
||||
hum->born_point = AllocBornPoint(hum);
|
||||
}
|
||||
for (auto& pair : team_hash_) {
|
||||
if (pair.second.size() < 2) {
|
||||
continue;
|
||||
}
|
||||
Human* target = nullptr;
|
||||
for (Human* hum : pair.second) {
|
||||
if (!target) {
|
||||
@ -1761,11 +1770,15 @@ void Room::SecondRandPoint()
|
||||
DecBornPointHumanNum(hum->born_point, hum);
|
||||
}
|
||||
hum->born_point = target->born_point;
|
||||
if (hum->born_point) {
|
||||
IncBornPointHumanNum(hum->born_point, hum);
|
||||
}
|
||||
}
|
||||
} //end if
|
||||
if (!hum->born_point) {
|
||||
hum->SetX(DEFAULT_BORN_POINT_X + rand() % 100);
|
||||
hum->SetY(DEFAULT_BORN_POINT_Y + rand() % 200);
|
||||
} else {
|
||||
IncBornPointHumanNum(hum->born_point, hum);
|
||||
hum->SetPos(hum->born_point->RandPoint());
|
||||
}
|
||||
hum->FindLocation();
|
||||
@ -1774,8 +1787,6 @@ void Room::SecondRandPoint()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Room::NotifyGameStart()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user