summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/navigation/nav_map.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/navigation/nav_map.cpp b/modules/navigation/nav_map.cpp
index b1674c8fc5..4dcdbd6446 100644
--- a/modules/navigation/nav_map.cpp
+++ b/modules/navigation/nav_map.cpp
@@ -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);
}