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
This commit is contained in:
jackpoz
2020-08-23 20:06:26 +02:00
parent 7cdc4b46bb
commit 1aceb41349

View File

@@ -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;