From 45e1dd7376eaec8dcd84b0e82caca16cfa5d3611 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Sun, 24 Jan 2021 10:14:13 +0100 Subject: [PATCH] Core/PathFinding: re-added a accidentally dropped path length limit sanitizer --- src/server/game/Movement/PathGenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp index 94683e143ed..b6e1cf8ac21 100644 --- a/src/server/game/Movement/PathGenerator.cpp +++ b/src/server/game/Movement/PathGenerator.cpp @@ -1041,7 +1041,7 @@ bool PathGenerator::IsInvalidDestinationZ(Unit const* target) const void PathGenerator::SetPathLengthLimit(float length) { - _pointPathLimit = uint32(ceilf(length / RECAST_PATH_STEP_SIZE)); + _pointPathLimit = std::min(uint32(ceilf(length / RECAST_PATH_STEP_SIZE)), MAX_PATH_LENGTH); } void PathGenerator::AddFarFromPolyFlags(bool startFarFromPoly, bool endFarFromPoly)