mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-31 13:06:42 +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);
|
storage.mReadyToAttack = (currentAction->isAttackingOrSpell() && distToTarget <= rangeAttack && storage.mLOS);
|
||||||
|
|
||||||
if (storage.mReadyToAttack)
|
|
||||||
{
|
|
||||||
if (isRangedCombat)
|
if (isRangedCombat)
|
||||||
{
|
{
|
||||||
// rotate actor taking into account target movement direction and projectile speed
|
// 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
|
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);
|
storage.startCombatMove(isRangedCombat, distToTarget, rangeAttack, actor, target);
|
||||||
// start new attack
|
// start new attack
|
||||||
storage.startAttackIfReady(actor, characterController, weapon, isRangedCombat);
|
storage.startAttackIfReady(actor, characterController, weapon, isRangedCombat);
|
||||||
|
|
Loading…
Reference in a new issue