mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-25 11:21:58 +01:00
Core/Movement: do not use mmap raycasts when the movement generator owner is ignoring pathfinding (units on transport for example)
This commit is contained in:
@@ -208,14 +208,16 @@ void ChaseMovementGenerator::LaunchMovement(Unit* owner, Unit* target, float cha
|
||||
|
||||
float additionalRange = target->GetSpeed(moveType) * 0.5f;
|
||||
|
||||
target->MovePositionToFirstCollision(dest, additionalRange, _angle ? target->NormalizeOrientation(target->GetOrientation() - _angle->RelativeAngle + float(M_PI)) : target->GetRelativeAngle(owner) + float(M_PI));
|
||||
if (!owner->HasUnitState(UNIT_STATE_IGNORE_PATHFINDING))
|
||||
target->MovePositionToFirstCollision(dest, additionalRange, _angle ? target->NormalizeOrientation(target->GetOrientation() - _angle->RelativeAngle + float(M_PI)) : target->GetRelativeAngle(owner) + float(M_PI));
|
||||
}
|
||||
else
|
||||
else if (!owner->HasUnitState(UNIT_STATE_IGNORE_PATHFINDING))
|
||||
target->MovePositionToFirstCollision(dest, chaseRange, _angle ? target->NormalizeOrientation(target->GetOrientation() - _angle->RelativeAngle) : target->GetRelativeAngle(owner));
|
||||
|
||||
owner->UpdateAllowedPositionZ(dest.GetPositionX(), dest.GetPositionY(), dest.m_positionZ);
|
||||
|
||||
Creature* creature = owner->ToCreature();
|
||||
Movement::MoveSplineInit init(owner);
|
||||
|
||||
PathGenerator path(owner);
|
||||
bool success = path.CalculatePath(dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ(), owner->CanFly());
|
||||
@@ -228,7 +230,6 @@ void ChaseMovementGenerator::LaunchMovement(Unit* owner, Unit* target, float cha
|
||||
return;
|
||||
}
|
||||
|
||||
Movement::MoveSplineInit init(owner);
|
||||
init.MovebyPath(path.GetPath());
|
||||
init.SetWalk(false);
|
||||
if (backward)
|
||||
|
||||
@@ -161,10 +161,13 @@ bool FollowMovementGenerator::Update(Unit* owner, uint32 diff)
|
||||
dest.m_positionY += std::sin(Position::NormalizeOrientation(target->GetOrientation() + offset)) * (velocity * 2);
|
||||
|
||||
// Now we calculate out actual destination data
|
||||
float relativeAngle = target->GetRelativeAngle(dest);
|
||||
float distance = target->GetExactDist2d(dest);
|
||||
dest = target->GetPosition();
|
||||
target->MovePositionToFirstCollision(dest, distance, relativeAngle);
|
||||
if (!owner->HasUnitState(UNIT_STATE_IGNORE_PATHFINDING))
|
||||
{
|
||||
float relativeAngle = target->GetRelativeAngle(dest);
|
||||
float distance = target->GetExactDist2d(dest);
|
||||
dest = target->GetPosition();
|
||||
target->MovePositionToFirstCollision(dest, distance, relativeAngle);
|
||||
}
|
||||
|
||||
Movement::MoveSplineInit init(owner);
|
||||
init.MoveTo(dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ());
|
||||
|
||||
Reference in New Issue
Block a user