diff options
author | Alexander Harkness <me@bearbin.net> | 2015-06-09 10:15:08 +0200 |
---|---|---|
committer | Alexander Harkness <me@bearbin.net> | 2015-06-09 10:15:08 +0200 |
commit | 1e77f271916ee1d1ee8c0047234662c29d2057bc (patch) | |
tree | 85cc42b6f276ff368ed70cc6e50d7000807652c7 /src/Mobs | |
parent | Merge pull request #2221 from mc-server/AreaCountBlocks (diff) | |
parent | Added moar comments (diff) | |
download | cuberite-1e77f271916ee1d1ee8c0047234662c29d2057bc.tar cuberite-1e77f271916ee1d1ee8c0047234662c29d2057bc.tar.gz cuberite-1e77f271916ee1d1ee8c0047234662c29d2057bc.tar.bz2 cuberite-1e77f271916ee1d1ee8c0047234662c29d2057bc.tar.lz cuberite-1e77f271916ee1d1ee8c0047234662c29d2057bc.tar.xz cuberite-1e77f271916ee1d1ee8c0047234662c29d2057bc.tar.zst cuberite-1e77f271916ee1d1ee8c0047234662c29d2057bc.zip |
Diffstat (limited to '')
-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; |