diff options
author | Mattes D <github@xoft.cz> | 2015-05-03 11:51:09 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-05-03 11:51:09 +0200 |
commit | d757d75b6c5e1e8e604b544d73e6292a09781b1a (patch) | |
tree | 97167cb6cee1137db10569875158dd3e65aa5e73 /src/Mobs/Path.cpp | |
parent | Fixed multiple mbedtls inclusion. (diff) | |
parent | PathFinder - Crash fix, chunks in parameters are now references (diff) | |
download | cuberite-d757d75b6c5e1e8e604b544d73e6292a09781b1a.tar cuberite-d757d75b6c5e1e8e604b544d73e6292a09781b1a.tar.gz cuberite-d757d75b6c5e1e8e604b544d73e6292a09781b1a.tar.bz2 cuberite-d757d75b6c5e1e8e604b544d73e6292a09781b1a.tar.lz cuberite-d757d75b6c5e1e8e604b544d73e6292a09781b1a.tar.xz cuberite-d757d75b6c5e1e8e604b544d73e6292a09781b1a.tar.zst cuberite-d757d75b6c5e1e8e604b544d73e6292a09781b1a.zip |
Diffstat (limited to 'src/Mobs/Path.cpp')
-rw-r--r-- | src/Mobs/Path.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/Mobs/Path.cpp b/src/Mobs/Path.cpp index 32eff9d2b..f414b4c9e 100644 --- a/src/Mobs/Path.cpp +++ b/src/Mobs/Path.cpp @@ -35,17 +35,16 @@ bool compareHeuristics::operator()(cPathCell * & a_Cell1, cPathCell * & a_Cell2) /* cPath implementation */ cPath::cPath( - cChunk * a_Chunk, + cChunk & a_Chunk, const Vector3d & a_StartingPoint, const Vector3d & a_EndingPoint, int a_MaxSteps, double a_BoundingBoxWidth, double a_BoundingBoxHeight, int a_MaxUp, int a_MaxDown ) { - ASSERT(m_Chunk != nullptr); // TODO: if src not walkable OR dest not walkable, then abort. // Borrow a new "isWalkable" from ProcessIfWalkable, make ProcessIfWalkable also call isWalkable - m_Chunk = a_Chunk; + m_Chunk = &a_Chunk; m_Source = a_StartingPoint.Floor(); m_Destination = a_EndingPoint.Floor(); @@ -80,10 +79,9 @@ cPath::~cPath() -ePathFinderStatus cPath::Step(cChunk * a_Chunk) +ePathFinderStatus cPath::Step(cChunk & a_Chunk) { - m_Chunk = a_Chunk; - ASSERT(m_Chunk != nullptr); + m_Chunk = &a_Chunk; if (m_Status != ePathFinderStatus::CALCULATING) { return m_Status; |