mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-22 18:41:33 +00:00
Fix #5630 "NPCs momentarily turn when the player character is moving backwards during combat"
This commit is contained in:
parent
b85d507f35
commit
15078f5b3c
1 changed files with 16 additions and 16 deletions
|
@ -240,8 +240,6 @@ namespace MWMechanics
|
|||
|
||||
storage.mReadyToAttack = (currentAction->isAttackingOrSpell() && distToTarget <= rangeAttack && storage.mLOS);
|
||||
|
||||
if (storage.mReadyToAttack)
|
||||
{
|
||||
if (isRangedCombat)
|
||||
{
|
||||
// rotate actor taking into account target movement direction and projectile speed
|
||||
|
@ -258,6 +256,8 @@ namespace MWMechanics
|
|||
storage.mMovement.mRotation[2] = getZAngleToDir((vTargetPos-vActorPos)); // using vAimDir results in spastic movements since the head is animated
|
||||
}
|
||||
|
||||
if (storage.mReadyToAttack)
|
||||
{
|
||||
storage.startCombatMove(isRangedCombat, distToTarget, rangeAttack, actor, target);
|
||||
// start new attack
|
||||
storage.startAttackIfReady(actor, characterController, weapon, isRangedCombat);
|
||||
|
|
Loading…
Reference in a new issue