mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-06 13:15:33 +00:00
Don't play idlestorm animation when swimming
This commit is contained in:
parent
c0a81030bb
commit
b72d5c5190
2 changed files with 4 additions and 5 deletions
|
@ -504,8 +504,6 @@ void CharacterController::refreshCurrentAnims(CharacterState idle, CharacterStat
|
|||
mAnimation->play(mCurrentIdle, idlePriority, MWRender::Animation::BlendMask_All, false,
|
||||
1.0f, "start", "stop", 0.0f, ~0ul, true);
|
||||
}
|
||||
|
||||
updateIdleStormState();
|
||||
}
|
||||
|
||||
|
||||
|
@ -867,7 +865,7 @@ void CharacterController::updatePtr(const MWWorld::Ptr &ptr)
|
|||
mPtr = ptr;
|
||||
}
|
||||
|
||||
void CharacterController::updateIdleStormState()
|
||||
void CharacterController::updateIdleStormState(bool inwater)
|
||||
{
|
||||
bool inStormDirection = false;
|
||||
if (MWBase::Environment::get().getWorld()->isInStorm())
|
||||
|
@ -877,7 +875,7 @@ void CharacterController::updateIdleStormState()
|
|||
inStormDirection = std::acos(stormDirection * characterDirection / (stormDirection.length() * characterDirection.length()))
|
||||
> osg::DegreesToRadians(120.f);
|
||||
}
|
||||
if (inStormDirection && mUpperBodyState == UpperCharState_Nothing && mAnimation->hasAnimation("idlestorm"))
|
||||
if (inStormDirection && !inwater && mUpperBodyState == UpperCharState_Nothing && mAnimation->hasAnimation("idlestorm"))
|
||||
{
|
||||
float complete = 0;
|
||||
mAnimation->getInfo("idlestorm", &complete);
|
||||
|
@ -1796,6 +1794,7 @@ void CharacterController::update(float duration)
|
|||
forcestateupdate = updateCreatureState() || forcestateupdate;
|
||||
|
||||
refreshCurrentAnims(idlestate, movestate, jumpstate, forcestateupdate);
|
||||
updateIdleStormState(inwater);
|
||||
}
|
||||
|
||||
if (inJump)
|
||||
|
|
|
@ -196,7 +196,7 @@ class CharacterController : public MWRender::Animation::TextKeyListener
|
|||
|
||||
bool updateWeaponState();
|
||||
bool updateCreatureState();
|
||||
void updateIdleStormState();
|
||||
void updateIdleStormState(bool inwater);
|
||||
|
||||
void updateHeadTracking(float duration);
|
||||
|
||||
|
|
Loading…
Reference in a new issue