mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-24 00:39:49 +00:00
Fix being able to move slowly when over encumbered
This commit is contained in:
parent
dc17fa1636
commit
8bd712cc95
@ -461,6 +461,8 @@ void CharacterController::update(float duration, Movement &movement)
|
|||||||
|
|
||||||
Ogre::Vector3 moved = mAnimation->runAnimation(duration);
|
Ogre::Vector3 moved = mAnimation->runAnimation(duration);
|
||||||
// Ensure we're moving in generally the right direction
|
// Ensure we're moving in generally the right direction
|
||||||
|
if (speed > 0.f)
|
||||||
|
{
|
||||||
if((movement.mPosition[0] < 0.0f && movement.mPosition[0] < moved.x*2.0f) ||
|
if((movement.mPosition[0] < 0.0f && movement.mPosition[0] < moved.x*2.0f) ||
|
||||||
(movement.mPosition[0] > 0.0f && movement.mPosition[0] > moved.x*2.0f))
|
(movement.mPosition[0] > 0.0f && movement.mPosition[0] > moved.x*2.0f))
|
||||||
moved.x = movement.mPosition[0];
|
moved.x = movement.mPosition[0];
|
||||||
@ -470,6 +472,7 @@ void CharacterController::update(float duration, Movement &movement)
|
|||||||
if((movement.mPosition[2] < 0.0f && movement.mPosition[2] < moved.z*2.0f) ||
|
if((movement.mPosition[2] < 0.0f && movement.mPosition[2] < moved.z*2.0f) ||
|
||||||
(movement.mPosition[2] > 0.0f && movement.mPosition[2] > moved.z*2.0f))
|
(movement.mPosition[2] > 0.0f && movement.mPosition[2] > moved.z*2.0f))
|
||||||
moved.z = movement.mPosition[2];
|
moved.z = movement.mPosition[2];
|
||||||
|
}
|
||||||
|
|
||||||
movement.mPosition[0] = moved.x;
|
movement.mPosition[0] = moved.x;
|
||||||
movement.mPosition[1] = moved.y;
|
movement.mPosition[1] = moved.y;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user