diff options
author | wiseoldman95 <softwatt@gmx.com> | 2015-05-03 08:45:27 +0200 |
---|---|---|
committer | wiseoldman95 <softwatt@gmx.com> | 2015-05-03 09:49:06 +0200 |
commit | 599ad97b65139ad450e6f89e39b787c881f76672 (patch) | |
tree | 6976cddd3fc8b81fe0853bf3b6da019c5f9b5c24 /src/Mobs/Path.cpp | |
parent | Merge pull request #1925 from SafwatHalaby/PathFinder_Optimze (diff) | |
download | cuberite-599ad97b65139ad450e6f89e39b787c881f76672.tar cuberite-599ad97b65139ad450e6f89e39b787c881f76672.tar.gz cuberite-599ad97b65139ad450e6f89e39b787c881f76672.tar.bz2 cuberite-599ad97b65139ad450e6f89e39b787c881f76672.tar.lz cuberite-599ad97b65139ad450e6f89e39b787c881f76672.tar.xz cuberite-599ad97b65139ad450e6f89e39b787c881f76672.tar.zst cuberite-599ad97b65139ad450e6f89e39b787c881f76672.zip |
Diffstat (limited to '')
-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; |