From 17200cb226a8ea95a940e7093f14170098b80d34 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 18 Feb 2013 20:43:55 -0800 Subject: [PATCH] Don't try to move when there's no speed --- apps/openmw/mwmechanics/character.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 27bc62d07..00a58523d 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -185,7 +185,7 @@ Ogre::Vector3 CharacterController::update(float duration) bool isrunning = cls.getStance(mPtr, MWWorld::Class::Run); 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) setState(isrunning ? @@ -198,7 +198,7 @@ Ogre::Vector3 CharacterController::update(float duration) // Apply any forward/backward movement manually 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) setState(isrunning ?