diff options
Diffstat (limited to 'src/Mobs/Path.h')
-rw-r--r-- | src/Mobs/Path.h | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/src/Mobs/Path.h b/src/Mobs/Path.h index c250eece2..d4ad066e3 100644 --- a/src/Mobs/Path.h +++ b/src/Mobs/Path.h @@ -124,21 +124,6 @@ public: return m_PathPoints.size(); } - struct VectorHasher - { - std::size_t operator()(const Vector3i & a_Vector) const - { - // Guaranteed to have no hash collisions for any 128x128x128 area. Suitable for pathfinding. - int32_t t = 0; - t += static_cast<int8_t>(a_Vector.x); - t = t << 8; - t += static_cast<int8_t>(a_Vector.y); - t = t << 8; - t += static_cast<int8_t>(a_Vector.z); - t = t << 8; - return static_cast<size_t>(t); - } - }; private: /* General */ @@ -160,7 +145,7 @@ private: /* Pathfinding fields */ std::priority_queue<cPathCell *, std::vector<cPathCell *>, compareHeuristics> m_OpenList; - std::unordered_map<Vector3i, cPathCell, VectorHasher> m_Map; + std::unordered_map<Vector3i, cPathCell, VectorHasher<int>> m_Map; Vector3i m_Destination; Vector3i m_Source; int m_BoundingBoxWidth; |