1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-06-29 08:41:34 +00:00

Account for strafing when draw state is not nothing, and "turn to movement direction" is true

This commit is contained in:
Mads Buvik Sandvei 2023-11-04 14:13:02 +01:00
parent 68fe1361f1
commit 1edc82062d

View file

@ -2407,13 +2407,8 @@ namespace MWMechanics
// Note that while a complete movement animation cycle will have a well defined direction, no individual frame will, and
// therefore we have to determine the direction separately from the value of the movementFromAnimation variable.
float animMovementAngle = 0;
if (!Settings::game().mTurnToMovementDirection || isFirstPersonPlayer)
{
if (cls.getMovementSettings(mPtr).mIsStrafing)
animMovementAngle = movement.x() > 0 ? -osg::PI_2f : osg::PI_2f;
else
animMovementAngle = movement.y() >= 0 ? 0 : -osg::PIf;
}
if (cls.getMovementSettings(mPtr).mIsStrafing)
animMovementAngle = movement.x() > 0 ? -osg::PI_2f : osg::PI_2f;
else
{
animMovementAngle = mAnimation->getLegsYawRadians();