Movement tweaks

This commit is contained in:
郑佩茹
2023-03-21 13:49:14 -06:00
parent 0c09ba2b2e
commit be5c2ef7d9
5 changed files with 11 additions and 8 deletions

View File

@@ -981,7 +981,7 @@ bool MovementAction::ChaseTo(WorldObject* obj, float distance, float angle)
UpdateMovementState();
if (bot->IsSitState())
if (!bot->IsStandState())
bot->SetStandState(UNIT_STAND_STATE_STAND);
if (bot->IsNonMeleeSpellCast(true))
@@ -1288,11 +1288,13 @@ bool SetBehindTargetAction::Execute(Event event)
float angle = GetFollowAngle() / 3 + target->GetOrientation() + M_PI;
//return ChaseTo(target, 0.f, angle);
float distance = sPlayerbotAIConfig->contactDistance;
float x = target->GetPositionX() + cos(angle) * distance;
float y = target->GetPositionY() + sin(angle) * distance;
float z = target->GetPositionZ();
//bot->UpdateGroundPositionZ(x, y, z);
bot->UpdateGroundPositionZ(x, y, z);
return MoveTo(bot->GetMapId(), x, y, z);
}