From 8b4530740eeb663a87e5634c114905ae5be03cb7 Mon Sep 17 00:00:00 2001 From: Safwat Halaby Date: Mon, 21 Dec 2015 15:51:12 +0200 Subject: PF - Improved mob jumping --- src/Mobs/PathFinder.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/Mobs/PathFinder.cpp') 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(); -- cgit v1.2.3