mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Revert reach combat to
This commit is contained in:
@@ -790,16 +790,6 @@ bool MovementAction::ReachCombatTo(Unit* target, float distance)
|
||||
float dx = cos(angle) * needToGo + bx;
|
||||
float dy = sin(angle) * needToGo + by;
|
||||
float dz; // = std::max(bz, tz); // calc accurate z position to avoid stuck
|
||||
|
||||
if (target->HasUnitMovementFlag(MOVEMENTFLAG_FORWARD)) // target is moving forward, predict the position
|
||||
{
|
||||
float timeToGo = MoveDelay(abs(needToGo));
|
||||
float targetMoveDist = timeToGo * target->GetSpeed(MOVE_RUN);
|
||||
targetMoveDist = std::min(5.0f, targetMoveDist);
|
||||
dx += targetMoveDist * cos(target->GetOrientation());
|
||||
dy += targetMoveDist * sin(target->GetOrientation());
|
||||
}
|
||||
|
||||
if (distanceToTarget > CONTACT_DISTANCE)
|
||||
{
|
||||
dz = bz + (tz - bz) * (needToGo / distanceToTarget);
|
||||
@@ -808,11 +798,6 @@ bool MovementAction::ReachCombatTo(Unit* target, float distance)
|
||||
{
|
||||
dz = tz;
|
||||
}
|
||||
|
||||
if (!bot->GetMap()->CheckCollisionAndGetValidCoords(bot, bot->GetPositionX(), bot->GetPositionY(),
|
||||
bot->GetPositionZ(), dx, dy, dz))
|
||||
return false;
|
||||
|
||||
return MoveTo(target->GetMapId(), dx, dy, dz);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user