mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 06:06:23 +00:00
fix(Core/Movement): correct weird pathing by clearing old path (#7034)
- Closes #5220.
This commit is contained in:
@@ -111,6 +111,12 @@ class PathGenerator
|
||||
return len;
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
_polyLength = 0;
|
||||
_pathPoints.clear();
|
||||
}
|
||||
|
||||
private:
|
||||
dtPolyRef _pathPolyRefs[MAX_PATH_LENGTH]; // array of detour polygon references
|
||||
uint32 _polyLength; // number of polygons in the path
|
||||
@@ -139,12 +145,6 @@ class PathGenerator
|
||||
void SetActualEndPosition(G3D::Vector3 const& point) { _actualEndPosition = point; }
|
||||
void NormalizePath();
|
||||
|
||||
void Clear()
|
||||
{
|
||||
_polyLength = 0;
|
||||
_pathPoints.clear();
|
||||
}
|
||||
|
||||
bool InRange(G3D::Vector3 const& p1, G3D::Vector3 const& p2, float r, float h) const;
|
||||
float Dist3DSqr(G3D::Vector3 const& p1, G3D::Vector3 const& p2) const;
|
||||
bool InRangeYZX(float const* v1, float const* v2, float r, float h) const;
|
||||
|
||||
@@ -131,6 +131,8 @@ bool ChaseMovementGenerator<T>::DoUpdate(T* owner, uint32 time_diff)
|
||||
|
||||
if (!i_path || moveToward != _movingTowards)
|
||||
i_path = std::make_unique<PathGenerator>(owner);
|
||||
else
|
||||
i_path->Clear();
|
||||
|
||||
float x, y, z;
|
||||
bool shortenPath;
|
||||
|
||||
Reference in New Issue
Block a user