Core/Movement: added some overloads to PathGenerator::CalculatePath

This commit is contained in:
Ovahlord committed 2023-08-24 20:51:15 +02:00
1 parent a9751de67c
commit ff3beb0e92
2 files changed
+14

No files matched your search

@@ -23,6 +23,7 @@
#include "MMapFactory.h"
#include "MMapManager.h"
#include "Log.h"
#include "Position.h"
#include "DisableMgr.h"
#include "DetourCommon.h"
#include "DetourNavMeshQuery.h"
@@ -61,6 +62,16 @@ bool PathGenerator::CalculatePath(float destX, float destY, float destZ, bool fo
return CalculatePath(PositionToVector3(_source->GetPosition()), G3D::Vector3(destX, destY, destZ), forceDest);
}
bool PathGenerator::CalculatePath(Position const& destination, bool forceDest /*= false*/)
{
return CalculatePath(PositionToVector3(_source->GetPosition()), PositionToVector3(destination), forceDest);
}
bool PathGenerator::CalculatePath(Position const& startPosition, Position const& destination, bool forceDest /*= false*/)
{
return CalculatePath(PositionToVector3(startPosition), PositionToVector3(destination), forceDest);
}
bool PathGenerator::CalculatePath(G3D::Vector3 const& startPoint, G3D::Vector3 const& endPoint, bool forceDest /*= false*/)
{
if (!Trinity::IsValidMapCoord(startPoint.x, startPoint.y, startPoint.z) || !Trinity::IsValidMapCoord(endPoint.x, endPoint.y, endPoint.z))
+3
View File
@@ -26,6 +26,7 @@
class Unit;
class WorldObject;
struct Position;
// 74*4.0f=296y number_of_points*interval = max_path_len
// this is way more than actual evade range
@@ -67,6 +68,8 @@ class TC_GAME_API PathGenerator
// Calculate the path from owner to given destination
// return: true if new path was calculated, false otherwise (no change needed)
bool CalculatePath(float destX, float destY, float destZ, bool forceDest = false);
bool CalculatePath(Position const& destination, bool forceDest = false);
bool CalculatePath(Position const& startPosition, Position const& destination, bool forceDest = false);
// Calculates the path from start point to given destination
bool CalculatePath(G3D::Vector3 const& startPoint, G3D::Vector3 const& endPoint, bool forceDest = false);
bool IsInvalidDestinationZ(Unit const* target) const;