Skip to content

Commit

Permalink
fix an index error
Browse files Browse the repository at this point in the history
  • Loading branch information
Wisdommmmmmmm authored and jakobbotsch committed Nov 18, 2020
1 parent 24230e8 commit 6624e7a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions DetourCrowd/Source/DetourCrowd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1409,12 +1409,14 @@ void dtCrowd::update(const float dt, dtCrowdAgentDebugInfo* debug)
}

// Update agents using off-mesh connection.
for (int i = 0; i < m_maxAgents; ++i)
for (int i = 0; i < nagents; ++i)
{
dtCrowdAgentAnimation* anim = &m_agentAnims[i];
dtCrowdAgent* ag = agents[i];
const int idx = (int)(ag - m_agents);
dtCrowdAgentAnimation* anim = &m_agentAnims[idx];
if (!anim->active)
continue;
dtCrowdAgent* ag = agents[i];


anim->t += dt;
if (anim->t > anim->tmax)
Expand Down

0 comments on commit 6624e7a

Please sign in to comment.