mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-13 20:39:40 +00:00
Don't try to move when there's no speed
This commit is contained in:
parent
5eca26903a
commit
17200cb226
1 changed files with 2 additions and 2 deletions
|
@ -185,7 +185,7 @@ Ogre::Vector3 CharacterController::update(float duration)
|
||||||
bool isrunning = cls.getStance(mPtr, MWWorld::Class::Run);
|
bool isrunning = cls.getStance(mPtr, MWWorld::Class::Run);
|
||||||
speed = cls.getSpeed(mPtr);
|
speed = cls.getSpeed(mPtr);
|
||||||
|
|
||||||
if(std::abs(vec.x/2.0f) > std::abs(vec.y))
|
if(std::abs(vec.x/2.0f) > std::abs(vec.y) && speed > 0.0f)
|
||||||
{
|
{
|
||||||
if(vec.x > 0.0f)
|
if(vec.x > 0.0f)
|
||||||
setState(isrunning ?
|
setState(isrunning ?
|
||||||
|
@ -198,7 +198,7 @@ Ogre::Vector3 CharacterController::update(float duration)
|
||||||
// Apply any forward/backward movement manually
|
// Apply any forward/backward movement manually
|
||||||
movement.y += vec.y * (speed*duration);
|
movement.y += vec.y * (speed*duration);
|
||||||
}
|
}
|
||||||
else if(vec.y != 0.0f)
|
else if(vec.y != 0.0f && speed > 0.0f)
|
||||||
{
|
{
|
||||||
if(vec.y > 0.0f)
|
if(vec.y > 0.0f)
|
||||||
setState(isrunning ?
|
setState(isrunning ?
|
||||||
|
|
Loading…
Reference in a new issue