1
This commit is contained in:
parent
bea50ff09c
commit
a883854ab1
@ -3164,6 +3164,30 @@ void Room::OnBattleStart()
|
|||||||
std::shuffle(born_point_list.begin(),
|
std::shuffle(born_point_list.begin(),
|
||||||
born_point_list.end(),
|
born_point_list.end(),
|
||||||
std::default_random_engine(a8::XGetTickCount()));
|
std::default_random_engine(a8::XGetTickCount()));
|
||||||
|
size_t cur_point_idx = 0;
|
||||||
|
TraverseTeams
|
||||||
|
(
|
||||||
|
[this, &born_point_list, &cur_point_idx] (Team* ele_team) mutable -> bool
|
||||||
|
{
|
||||||
|
if (cur_point_idx >= born_point_list.size()) {
|
||||||
|
cur_point_idx = 0;
|
||||||
|
}
|
||||||
|
auto point = born_point_list.at(cur_point_idx++);
|
||||||
|
ele_team->TraverseMembers
|
||||||
|
(
|
||||||
|
[point] (Human* hum) -> bool
|
||||||
|
{
|
||||||
|
if (hum->IsPlayer()) {
|
||||||
|
point->player_num++;
|
||||||
|
} else {
|
||||||
|
point->android_num++;
|
||||||
|
}
|
||||||
|
hum->SetBornPoint(point);
|
||||||
|
hum->SetPos(hum->GetBornPoint()->RandPoint(hum->room));
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
battle_starting_ = false;
|
battle_starting_ = false;
|
||||||
SendSMTeamFull(nullptr);
|
SendSMTeamFull(nullptr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user