mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-29 22:20:33 +00:00
Merge branch 'idlestorm' into 'master'
Avoid redundant animation resets in updateIdleStormState See merge request OpenMW/openmw!3473
This commit is contained in:
commit
d43493dd4c
@ -1166,9 +1166,14 @@ namespace MWMechanics
|
|||||||
|
|
||||||
void CharacterController::updateIdleStormState(bool inwater) const
|
void CharacterController::updateIdleStormState(bool inwater) const
|
||||||
{
|
{
|
||||||
if (!mAnimation->hasAnimation("idlestorm") || mUpperBodyState != UpperBodyState::None || inwater)
|
if (!mAnimation->hasAnimation("idlestorm"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
bool animPlaying = mAnimation->isPlaying("idlestorm");
|
||||||
|
if (mUpperBodyState != UpperBodyState::None || inwater)
|
||||||
{
|
{
|
||||||
mAnimation->disable("idlestorm");
|
if (animPlaying)
|
||||||
|
mAnimation->disable("idlestorm");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1181,7 +1186,7 @@ namespace MWMechanics
|
|||||||
characterDirection.normalize();
|
characterDirection.normalize();
|
||||||
if (stormDirection * characterDirection < -0.5f)
|
if (stormDirection * characterDirection < -0.5f)
|
||||||
{
|
{
|
||||||
if (!mAnimation->isPlaying("idlestorm"))
|
if (!animPlaying)
|
||||||
{
|
{
|
||||||
int mask = MWRender::Animation::BlendMask_Torso | MWRender::Animation::BlendMask_RightArm;
|
int mask = MWRender::Animation::BlendMask_Torso | MWRender::Animation::BlendMask_RightArm;
|
||||||
mAnimation->play("idlestorm", Priority_Storm, mask, true, 1.0f, "start", "stop", 0.0f, ~0ul);
|
mAnimation->play("idlestorm", Priority_Storm, mask, true, 1.0f, "start", "stop", 0.0f, ~0ul);
|
||||||
@ -1194,7 +1199,7 @@ namespace MWMechanics
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mAnimation->isPlaying("idlestorm"))
|
if (animPlaying)
|
||||||
{
|
{
|
||||||
mAnimation->setLoopingEnabled("idlestorm", false);
|
mAnimation->setLoopingEnabled("idlestorm", false);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user