Core/Movement: Fix RandomMovementGenerator for swimming creatures

Fix RandomMovementGenerator for swimming creatures not moving at all due to PATHFIND_FARFROMPOLY being handled as wrong path.
Fixes #25236

(cherry picked from commit 1aceb413495c18e5840112d6ada0c4c71cc03c7b)
This commit is contained in:
jackpoz
2022-02-04 00:27:12 +01:00
committed by Shauren
parent 0150828841
commit 1f34964df4
@@ -141,9 +141,10 @@ void RandomMovementGenerator<Creature>::SetRandomLocation(Creature* owner)
}
bool result = _path->CalculatePath(position.GetPositionX(), position.GetPositionY(), position.GetPositionZ());
// PATHFIND_FARFROMPOLY shouldn't be checked as creatures in water are most likely far from poly
if (!result || (_path->GetPathType() & PATHFIND_NOPATH)
|| (_path->GetPathType() & PATHFIND_SHORTCUT)
|| (_path->GetPathType() & PATHFIND_FARFROMPOLY))
/*|| (_path->GetPathType() & PATHFIND_FARFROMPOLY)*/)
{
_timer.Reset(100);
return;