1
0

PF - Improved mob jumping

This commit is contained in:
Safwat Halaby
2015-12-21 15:51:12 +02:00
parent e6d74553a2
commit 8b4530740e
3 changed files with 155 additions and 85 deletions

View File

@@ -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();