diff options
author | Safwat Halaby <SafwatHalaby@users.noreply.github.com> | 2015-12-22 06:42:28 +0100 |
---|---|---|
committer | Safwat Halaby <SafwatHalaby@users.noreply.github.com> | 2015-12-22 06:42:28 +0100 |
commit | d112632d6a10034fd989e285ce87d6199832d620 (patch) | |
tree | 2df1479569ed70c839d047b8864726c78febe386 /src/Mobs/PathFinder.cpp | |
parent | Merge pull request #2791 from then0rTh/master (diff) | |
parent | PF - Improved mob jumping (diff) | |
download | cuberite-d112632d6a10034fd989e285ce87d6199832d620.tar cuberite-d112632d6a10034fd989e285ce87d6199832d620.tar.gz cuberite-d112632d6a10034fd989e285ce87d6199832d620.tar.bz2 cuberite-d112632d6a10034fd989e285ce87d6199832d620.tar.lz cuberite-d112632d6a10034fd989e285ce87d6199832d620.tar.xz cuberite-d112632d6a10034fd989e285ce87d6199832d620.tar.zst cuberite-d112632d6a10034fd989e285ce87d6199832d620.zip |
Diffstat (limited to 'src/Mobs/PathFinder.cpp')
-rw-r--r-- | src/Mobs/PathFinder.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Mobs/PathFinder.cpp b/src/Mobs/PathFinder.cpp index 28dce4dc2..bc79e2440 100644 --- a/src/Mobs/PathFinder.cpp +++ b/src/Mobs/PathFinder.cpp @@ -107,8 +107,12 @@ ePathFinderStatus cPathFinder::GetNextWayPoint(cChunk & a_Chunk, const Vector3d } } + Vector3d Waypoint(m_WayPoint); + Vector3d Source(m_Source); + Waypoint.y = 0; + Source.y = 0; - if (m_Path->IsFirstPoint() || ((m_WayPoint - m_Source).SqrLength() < WAYPOINT_RADIUS)) + if (m_Path->IsFirstPoint() || (((Waypoint - Source).SqrLength() < WAYPOINT_RADIUS) && (m_Source.y >= m_WayPoint.y))) { // if the mob has just started or if the mob reached a waypoint, give them a new waypoint. m_WayPoint = m_Path->GetNextPoint(); |