Merge pull request #74893 from smix8/fix_agents_with_disabled_avoidance_4.x

Fix agents with disabled avoidance getting added to avoidance simulation
This commit is contained in:
Yuri Sizov 2023-03-21 12:06:22 +01:00 committed by GitHub
commit 66ff25a3ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -894,9 +894,9 @@ void NavMap::sync() {
if (agents_dirty) {
// cannot use LocalVector here as RVO library expects std::vector to build KdTree
std::vector<RVO::Agent *> raw_agents;
raw_agents.reserve(agents.size());
for (NavAgent *agent : agents) {
raw_agents.push_back(agent->get_agent());
raw_agents.reserve(controlled_agents.size());
for (NavAgent *controlled_agent : controlled_agents) {
raw_agents.push_back(controlled_agent->get_agent());
}
rvo.buildAgentTree(raw_agents);
}