Fix for a crash in path queue. Bail out if cannot init obstacle query.
This commit is contained in:
parent
6c6a62e3b1
commit
1f2aea55f5
@ -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);
|
||||
|
@ -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()
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user