1
This commit is contained in:
parent
f330657fbd
commit
7e67bc5f5e
@ -21,18 +21,17 @@ namespace mt
|
||||
|
||||
const mt::Robot* Robot::RandRobot(std::set<int>& refreshed_robot_set)
|
||||
{
|
||||
#if 0
|
||||
int try_count = 0;
|
||||
while (true) {
|
||||
MetaData::Robot& tmp_robot_meta = loader_->robot_list[rand() % loader_->robot_list.size()];
|
||||
if (refreshed_robot_set.find(tmp_robot_meta.pb->id()) == refreshed_robot_set.end()) {
|
||||
return &tmp_robot_meta;
|
||||
}
|
||||
++try_count;
|
||||
if (try_count > 3000) {
|
||||
return nullptr;
|
||||
int try_count = 0;
|
||||
while (true) {
|
||||
const mt::Robot* tmp_robot_meta = raw_list[rand() % raw_list.size()];
|
||||
if (refreshed_robot_set.find(tmp_robot_meta->id()) == refreshed_robot_set.end()) {
|
||||
return tmp_robot_meta;
|
||||
}
|
||||
++try_count;
|
||||
if (try_count > 3000) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user