diff --git a/DetourCrowd/Source/DetourCrowd.cpp b/DetourCrowd/Source/DetourCrowd.cpp index b46d7c7..a3614d2 100644 --- a/DetourCrowd/Source/DetourCrowd.cpp +++ b/DetourCrowd/Source/DetourCrowd.cpp @@ -217,6 +217,7 @@ void dtCrowd::purge() dtFree(m_moveRequests); m_moveRequests = 0; + m_moveRequestCount = 0; dtFreeProximityGrid(m_grid); m_grid = 0; @@ -246,7 +247,8 @@ bool dtCrowd::init(const int maxAgents, const float maxAgentRadius, dtNavMesh* n m_obstacleQuery = dtAllocObstacleAvoidanceQuery(); if (!m_obstacleQuery) return false; - m_obstacleQuery->init(6, 8); + if (!m_obstacleQuery->init(6, 8)) + return false; m_obstacleQuery->setDesiredVelocityWeight(2.0f); m_obstacleQuery->setCurrentVelocityWeight(0.75f); diff --git a/DetourCrowd/Source/DetourPathQueue.cpp b/DetourCrowd/Source/DetourPathQueue.cpp index f7c4c48..de1862a 100644 --- a/DetourCrowd/Source/DetourPathQueue.cpp +++ b/DetourCrowd/Source/DetourPathQueue.cpp @@ -30,6 +30,8 @@ dtPathQueue::dtPathQueue() : m_queueHead(0), m_navquery(0) { + for (int i = 0; i < MAX_QUEUE; ++i) + m_queue[i].path = 0; } dtPathQueue::~dtPathQueue() diff --git a/RecastDemo/Bin/Recast.app/Contents/MacOS/Recast b/RecastDemo/Bin/Recast.app/Contents/MacOS/Recast index 08b6961..e925440 100755 Binary files a/RecastDemo/Bin/Recast.app/Contents/MacOS/Recast and b/RecastDemo/Bin/Recast.app/Contents/MacOS/Recast differ