添加新手组队处理

This commit is contained in:
aozhiwei 2020-05-26 20:25:20 +08:00
parent 2a31081009
commit f593386448
2 changed files with 12 additions and 1 deletions

View File

@ -230,7 +230,7 @@ namespace MetaData
}
}
} else if (total_weight > 0) {
int rnd = rand() % total_weight;
int rnd = rand() % (total_weight + 1);
for (auto& item : items) {
if (std::get<3>(item) >= rnd) {
for (size_t i = 0; i < std::get<0>(item).size(); ++i) {

View File

@ -1028,6 +1028,17 @@ void Room::CombineTeam()
hum->auto_fill = true;
hum->team_uuid = a8::XValue(room_uuid).GetString();
}
for (size_t i = 0; i < 4 - accountid_hash_.size(); ++i) {
for (auto& pair : human_hash_) {
Human* hum = pair.second;
if (hum->IsAndroid() &&
!hum->auto_fill) {
hum->auto_fill = true;
hum->team_uuid = a8::XValue(room_uuid).GetString();
break;
}
}
}
}
int first_team_id = 0;