summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Path.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2015-06-02 14:29:52 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2015-06-06 13:21:21 +0200
commit171c59a01b07b7513cf7a281bbcb141e8182d274 (patch)
tree6fd4b835b68b2dcde80a3f868d0b83f2987d2a54 /src/Mobs/Path.h
parentImproved link power behaviour (diff)
downloadcuberite-171c59a01b07b7513cf7a281bbcb141e8182d274.tar
cuberite-171c59a01b07b7513cf7a281bbcb141e8182d274.tar.gz
cuberite-171c59a01b07b7513cf7a281bbcb141e8182d274.tar.bz2
cuberite-171c59a01b07b7513cf7a281bbcb141e8182d274.tar.lz
cuberite-171c59a01b07b7513cf7a281bbcb141e8182d274.tar.xz
cuberite-171c59a01b07b7513cf7a281bbcb141e8182d274.tar.zst
cuberite-171c59a01b07b7513cf7a281bbcb141e8182d274.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/Path.h17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/Mobs/Path.h b/src/Mobs/Path.h
index c250eece2..491165795 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, Vector3i> m_Map;
Vector3i m_Destination;
Vector3i m_Source;
int m_BoundingBoxWidth;