1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 22:23:51 +00:00

Merge branch 'fix_give_way' into 'master'

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

See merge request OpenMW/openmw!348
This commit is contained in:
Alexei Dobrohotov 2020-10-17 17:32:09 +00:00
commit 4966cd217e

View file

@ -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)