添加新手组队处理
This commit is contained in:
parent
2a31081009
commit
f593386448
@ -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) {
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user