diff options
author | SafwatHalaby <SafwatHalaby@users.noreply.github.com> | 2015-05-15 19:25:44 +0200 |
---|---|---|
committer | SafwatHalaby <SafwatHalaby@users.noreply.github.com> | 2015-05-15 19:25:44 +0200 |
commit | a8878dd2b6cee69b7cc92b19c740cc4deb7c9735 (patch) | |
tree | f43a8b0a7b66e741f3b7cfaa7dc0d485be4980bd /src/Mobs/Path.cpp | |
parent | Merge pull request #2022 from mc-server/ForEachCommandAPIFix (diff) | |
download | cuberite-a8878dd2b6cee69b7cc92b19c740cc4deb7c9735.tar cuberite-a8878dd2b6cee69b7cc92b19c740cc4deb7c9735.tar.gz cuberite-a8878dd2b6cee69b7cc92b19c740cc4deb7c9735.tar.bz2 cuberite-a8878dd2b6cee69b7cc92b19c740cc4deb7c9735.tar.lz cuberite-a8878dd2b6cee69b7cc92b19c740cc4deb7c9735.tar.xz cuberite-a8878dd2b6cee69b7cc92b19c740cc4deb7c9735.tar.zst cuberite-a8878dd2b6cee69b7cc92b19c740cc4deb7c9735.zip |
Diffstat (limited to 'src/Mobs/Path.cpp')
-rw-r--r-- | src/Mobs/Path.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/Mobs/Path.cpp b/src/Mobs/Path.cpp index ba7d615ae..dd306af13 100644 --- a/src/Mobs/Path.cpp +++ b/src/Mobs/Path.cpp @@ -215,11 +215,6 @@ 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>{}; } @@ -348,7 +343,7 @@ cPathCell * cPath::GetCell(const Vector3i & a_Location) { Cell = new cPathCell(); Cell->m_Location = a_Location; - m_Map[a_Location] = Cell; + m_Map[a_Location] = UniquePtr<cPathCell>(Cell); Cell->m_IsSolid = IsSolid(a_Location); Cell->m_Status = eCellStatus::NOLIST; #ifdef COMPILING_PATHFIND_DEBUGGER @@ -360,6 +355,6 @@ cPathCell * cPath::GetCell(const Vector3i & a_Location) } else { - return m_Map[a_Location]; + return m_Map[a_Location].get(); } } |