Merge branch 'fix_give_way' into 'master'

Use full speed in the "NPCs give way" maneuver.

See merge request OpenMW/openmw!348
pull/3019/head
Alexei Dobrohotov 4 years ago
commit 4966cd217e

@ -1804,11 +1804,9 @@ namespace MWMechanics
osg::Vec2f newMovement = origMovement + movementCorrection;
// Step to the side rather than backward. Otherwise player will be able to push the NPC far away from it's original location.
newMovement.y() = std::max(newMovement.y(), 0.f);
newMovement.normalize();
if (isMoving)
{ // Keep the original speed.
newMovement.normalize();
newMovement *= origMovement.length();
}
newMovement *= origMovement.length(); // Keep the original speed.
movement.mPosition[0] = newMovement.x();
movement.mPosition[1] = newMovement.y();
if (shouldTurnToApproachingActor)

Loading…
Cancel
Save