mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 09:17:36 +01:00
Core/Movement: setting path length limits will now round the amount of smooth path points up instead of down to reduce edge cases in which charge effects close to their maximum cast range would return no path
This commit is contained in:
@@ -1031,6 +1031,14 @@ bool PathGenerator::IsInvalidDestinationZ(Unit const* target) const
|
||||
return (target->GetPositionZ() - GetActualEndPosition().z) > 5.0f;
|
||||
}
|
||||
|
||||
void PathGenerator::SetPathLengthLimit(float length)
|
||||
{
|
||||
if (!(uint32(length) % 4))
|
||||
_pointPathLimit = std::min<uint32>(length / SMOOTH_PATH_STEP_SIZE, MAX_POINT_PATH_LENGTH);
|
||||
else
|
||||
_pointPathLimit = std::min<uint32>((length + SMOOTH_PATH_STEP_SIZE) / SMOOTH_PATH_STEP_SIZE, MAX_POINT_PATH_LENGTH);
|
||||
}
|
||||
|
||||
void PathGenerator::AddFarFromPolyFlags(bool startFarFromPoly, bool endFarFromPoly)
|
||||
{
|
||||
if (startFarFromPoly)
|
||||
|
||||
@@ -66,7 +66,7 @@ class TC_GAME_API PathGenerator
|
||||
|
||||
// option setters - use optional
|
||||
void SetUseStraightPath(bool useStraightPath) { _useStraightPath = useStraightPath; }
|
||||
void SetPathLengthLimit(float distance) { _pointPathLimit = std::min<uint32>(uint32(distance/SMOOTH_PATH_STEP_SIZE), MAX_POINT_PATH_LENGTH); }
|
||||
void SetPathLengthLimit(float distance);
|
||||
void SetUseRaycast(bool useRaycast) { _useRaycast = useRaycast; }
|
||||
|
||||
// result getters
|
||||
|
||||
Reference in New Issue
Block a user