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:
parent
57f7ef1db4
commit
b1a449a0b9
@ -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)
|
||||
{
|
||||
|
@ -147,6 +147,7 @@ class CharacterController
|
||||
CharacterState mMovementState;
|
||||
std::string mCurrentMovement;
|
||||
float mMovementSpeed;
|
||||
bool mHasMovedInXY;
|
||||
bool mMovementAnimationControlled;
|
||||
|
||||
CharacterState mDeathState;
|
||||
|
Loading…
Reference in New Issue
Block a user