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)
|
const mt::Robot* Robot::RandRobot(std::set<int>& refreshed_robot_set)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
int try_count = 0;
|
int try_count = 0;
|
||||||
while (true) {
|
while (true) {
|
||||||
MetaData::Robot& tmp_robot_meta = loader_->robot_list[rand() % loader_->robot_list.size()];
|
const mt::Robot* tmp_robot_meta = raw_list[rand() % raw_list.size()];
|
||||||
if (refreshed_robot_set.find(tmp_robot_meta.pb->id()) == refreshed_robot_set.end()) {
|
if (refreshed_robot_set.find(tmp_robot_meta->id()) == refreshed_robot_set.end()) {
|
||||||
return &tmp_robot_meta;
|
return tmp_robot_meta;
|
||||||
}
|
}
|
||||||
++try_count;
|
++try_count;
|
||||||
if (try_count > 3000) {
|
if (try_count > 3000) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user