1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-06 00:55:50 +00:00

Fix wolfrun sound playing all the time when running is default

This commit is contained in:
MiroslavR 2014-09-06 05:52:47 +02:00
parent 57f7ef1db4
commit b1a449a0b9
2 changed files with 5 additions and 2 deletions

View File

@ -794,6 +794,7 @@ bool CharacterController::updateWeaponState()
{
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
if(cls.getCreatureStats(mPtr).getStance(MWMechanics::CreatureStats::Stance_Run)
&& mHasMovedInXY
&& !MWBase::Environment::get().getWorld()->isSwimming(mPtr)
&& mWeaponType == WeapType_None)
{
@ -1249,11 +1250,12 @@ void CharacterController::update(float duration)
CharacterState idlestate = CharState_SpecialIdle;
bool forcestateupdate = false;
isrunning = isrunning && std::abs(vec[0])+std::abs(vec[1]) > 0.0f;
mHasMovedInXY = std::abs(vec[0])+std::abs(vec[1]) > 0.0f;
isrunning = isrunning && mHasMovedInXY;
// advance athletics
if(std::abs(vec[0])+std::abs(vec[1]) > 0.0f && mPtr.getRefData().getHandle() == "player")
if(mHasMovedInXY && mPtr.getRefData().getHandle() == "player")
{
if(inwater)
{

View File

@ -147,6 +147,7 @@ class CharacterController
CharacterState mMovementState;
std::string mCurrentMovement;
float mMovementSpeed;
bool mHasMovedInXY;
bool mMovementAnimationControlled;
CharacterState mDeathState;