修复出生点不随机问题
This commit is contained in:
parent
1f9e7a169f
commit
eb4c1e8172
@ -2055,13 +2055,16 @@ BornPoint* Room::AllocBornPoint(Human* hum)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
std::vector<BornPoint*> free_point_list;
|
||||
for (auto& pair : born_point_hash_) {
|
||||
if (pair.second.player_num + pair.second.android_num <
|
||||
pair.second.thing_tpl->param1_int) {
|
||||
born_point = &pair.second;
|
||||
break;
|
||||
free_point_list.push_back(&pair.second);
|
||||
}
|
||||
}
|
||||
if (!free_point_list.empty()) {
|
||||
born_point = free_point_list[rand() % free_point_list.size()];
|
||||
}
|
||||
}
|
||||
if (born_point) {
|
||||
IncBornPointHumanNum(born_point, hum);
|
||||
|
Loading…
x
Reference in New Issue
Block a user