1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-28 14:39:43 +00:00

movement = movementFromAnimation; also when speed is 0.

This commit is contained in:
Mads Buvik Sandvei 2023-11-05 16:46:11 +01:00
parent e86a4ebafe
commit acf6178ea5

View file

@ -2399,8 +2399,7 @@ namespace MWMechanics
movementFromAnimation.x() *= scale;
movementFromAnimation.y() *= scale;
if (speed > 0.f && movementFromAnimation != osg::Vec3f()
&& !(isPlayer && Settings::game().mPlayerMovementIgnoresAnimation))
if (speed > 0.f && movementFromAnimation != osg::Vec3f())
{
// Ensure we're moving in the right general direction. In vanilla, all horizontal movement is taken from
// animations, even when moving diagonally (which doesn't have a corresponding animation). So to acheive
@ -2413,9 +2412,12 @@ namespace MWMechanics
float animMovementAngle = getAnimationMovementDirection();
float targetMovementAngle = std::atan2(-movement.x(), movement.y());
float diff = targetMovementAngle - animMovementAngle;
movement = osg::Quat(diff, osg::Vec3f(0, 0, 1)) * movementFromAnimation;
movementFromAnimation = osg::Quat(diff, osg::Vec3f(0, 0, 1)) * movementFromAnimation;
}
if (!(isPlayer && Settings::game().mPlayerMovementIgnoresAnimation))
movement = movementFromAnimation;
if (mFloatToSurface)
{
if (cls.getCreatureStats(mPtr).isDead()