From 5c3a85fba10e801c6553fa943fa85605bbcd4f41 Mon Sep 17 00:00:00 2001 From: worktycho Date: Fri, 15 May 2015 18:54:45 +0100 Subject: Revert "PathFinder - smart pointers" --- src/Mobs/Path.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/Mobs/Path.cpp') 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, 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(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]; } } -- cgit v1.2.3