1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-30 13:36:42 +00:00

FIX(character.cpp): Don't allow turn to movement direction to apply to non-bipeds

This commit is contained in:
Dave Corley 2024-06-29 22:53:15 -05:00
parent c95c7503a8
commit 33cd654bf5

View file

@ -2042,7 +2042,8 @@ namespace MWMechanics
float effectiveRotation = rot.z();
bool canMove = cls.getMaxSpeed(mPtr) > 0;
const bool turnToMovementDirection = Settings::game().mTurnToMovementDirection;
if (!turnToMovementDirection || isFirstPersonPlayer)
const bool isBiped = mPtr.getClass().isBipedal(mPtr);
if (!isBiped || !turnToMovementDirection || isFirstPersonPlayer)
{
movementSettings.mIsStrafing = std::abs(vec.x()) > std::abs(vec.y()) * 2;
stats.setSideMovementAngle(0);
@ -2296,7 +2297,7 @@ namespace MWMechanics
}
}
if (turnToMovementDirection && !isFirstPersonPlayer
if (turnToMovementDirection && !isFirstPersonPlayer && isBiped
&& (movestate == CharState_SwimRunForward || movestate == CharState_SwimWalkForward
|| movestate == CharState_SwimRunBack || movestate == CharState_SwimWalkBack))
{