This commit is contained in:
aozhiwei 2022-12-25 16:14:55 +08:00
parent f330657fbd
commit 7e67bc5f5e

View File

@ -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
}
}