Core/Movement: allow hovering units to return PATHFIND_INCOMPLETE as their destination is always set off

This commit is contained in:
Ovahlord committed 2023-08-24 20:45:18 +02:00
1 parent 4e469f7fe0
commit a9751de67c
1 file changed
+3 -1
@@ -242,7 +242,9 @@ ChaseMovementPositionCheckResult ChaseMovementGenerator::checkPosition(ChasePosi
void ChaseMovementGenerator::launchSpline(Unit* owner, Unit* target, Position& destination)
{
bool success = _pathGenerator->CalculatePath(destination.GetPositionX(), destination.GetPositionY(), destination.GetPositionZ(), owner->IsFlying());
uint32 deniedPathResultTypes = PATHFIND_NOPATH | PATHFIND_INCOMPLETE;
uint32 deniedPathResultTypes = PATHFIND_NOPATH;
if (!owner->IsHovering())
deniedPathResultTypes |= PATHFIND_INCOMPLETE;
if (!owner->IsFlying() || (target->IsInWater() && !owner->CanEnterWater())) // only flying and swimming units may use shortcuts
deniedPathResultTypes |= PATHFIND_SHORTCUT;