mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Fix agents with disabled avoidance getting added to avoidance simulation
Fixes that agents with disabled avoidance were getting added to avoidance simulation.
(cherry picked from commit 64ce93cee9)
This commit is contained in:
parent
f089782411
commit
ac1b26c7c5
1 changed files with 3 additions and 3 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue