mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-14 15:48:01 +03:00
Fixed bot navigation route when connected area somehow is null
This commit is contained in:
parent
6c9019bcc8
commit
991573f165
@ -294,6 +294,8 @@ void CNavArea::OnDestroyNotify(CNavArea *dead)
|
||||
// Connect this area to given area in given direction
|
||||
void CNavArea::ConnectTo(CNavArea *area, NavDirType dir)
|
||||
{
|
||||
DbgAssert(area);
|
||||
|
||||
// check if already connected
|
||||
for (NavConnectList::iterator iter = m_connect[dir].begin(); iter != m_connect[dir].end(); iter++)
|
||||
{
|
||||
|
@ -683,7 +683,7 @@ bool NavAreaBuildPath(CNavArea *startArea, CNavArea *goalArea, const Vector *goa
|
||||
int ladderTopDir;
|
||||
while (true)
|
||||
{
|
||||
CNavArea *newArea;
|
||||
CNavArea *newArea = nullptr;
|
||||
NavTraverseType how;
|
||||
const CNavLadder *ladder = nullptr;
|
||||
|
||||
@ -716,6 +716,11 @@ bool NavAreaBuildPath(CNavArea *startArea, CNavArea *goalArea, const Vector *goa
|
||||
newArea = (*floorIter).area;
|
||||
how = (NavTraverseType)dir;
|
||||
floorIter++;
|
||||
|
||||
DbgAssert(newArea);
|
||||
|
||||
if (!newArea)
|
||||
continue;
|
||||
}
|
||||
// search ladders
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user