diff options
author | worktycho <work.tycho@gmail.com> | 2015-05-15 19:55:01 +0200 |
---|---|---|
committer | worktycho <work.tycho@gmail.com> | 2015-05-15 19:55:01 +0200 |
commit | 4605f4f1749d49472ecf7c34a931273a613bbf02 (patch) | |
tree | 627e85f1869cdd56acc28f35c18a2bd7e561bcac /src/Mobs/Path.cpp | |
parent | Merge pull request #2023 from SafwatHalaby/smartPointers (diff) | |
parent | Revert "PathFinder - smart pointers" (diff) | |
download | cuberite-4605f4f1749d49472ecf7c34a931273a613bbf02.tar cuberite-4605f4f1749d49472ecf7c34a931273a613bbf02.tar.gz cuberite-4605f4f1749d49472ecf7c34a931273a613bbf02.tar.bz2 cuberite-4605f4f1749d49472ecf7c34a931273a613bbf02.tar.lz cuberite-4605f4f1749d49472ecf7c34a931273a613bbf02.tar.xz cuberite-4605f4f1749d49472ecf7c34a931273a613bbf02.tar.zst cuberite-4605f4f1749d49472ecf7c34a931273a613bbf02.zip |
Diffstat (limited to 'src/Mobs/Path.cpp')
-rw-r--r-- | src/Mobs/Path.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Mobs/Path.cpp b/src/Mobs/Path.cpp index dd306af13..ba7d615ae 100644 --- a/src/Mobs/Path.cpp +++ b/src/Mobs/Path.cpp @@ -215,6 +215,11 @@ bool cPath::Step_Internal() void cPath::FinishCalculation() { + for (auto && pair : m_Map) + { + delete pair.second; + } + m_Map.clear(); m_OpenList = std::priority_queue<cPathCell *, std::vector<cPathCell *>, compareHeuristics>{}; } @@ -343,7 +348,7 @@ cPathCell * cPath::GetCell(const Vector3i & a_Location) { Cell = new cPathCell(); Cell->m_Location = a_Location; - m_Map[a_Location] = UniquePtr<cPathCell>(Cell); + m_Map[a_Location] = Cell; Cell->m_IsSolid = IsSolid(a_Location); Cell->m_Status = eCellStatus::NOLIST; #ifdef COMPILING_PATHFIND_DEBUGGER @@ -355,6 +360,6 @@ cPathCell * cPath::GetCell(const Vector3i & a_Location) } else { - return m_Map[a_Location].get(); + return m_Map[a_Location]; } } |