mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-05-13 05:56:56 +03:00
Don't restart the legs animation from the beginning in the same state
This prevent walking silently by switching weapons indefinitely
This commit is contained in:
parent
a14a2c9684
commit
8801834804
1 changed files with 17 additions and 1 deletions
|
@ -5530,7 +5530,23 @@ void Player::EvaluateState(State *forceTorso, State *forceLegs)
|
||||||
StopPartAnimating(legs);
|
StopPartAnimating(legs);
|
||||||
animdone_Legs = true;
|
animdone_Legs = true;
|
||||||
} else if (legsAnim != "") {
|
} else if (legsAnim != "") {
|
||||||
SetPartAnim(legsAnim, legs);
|
float oldTime;
|
||||||
|
|
||||||
|
if (currentState_Legs == laststate_Legs) {
|
||||||
|
//
|
||||||
|
// Added in OPM
|
||||||
|
// This allows different animations in the same state
|
||||||
|
// to be continued at the same moment.
|
||||||
|
// This is used to avoid "ghost walking" where the player
|
||||||
|
// would switch weapons indefinitely to avoid footstep sounds
|
||||||
|
//
|
||||||
|
|
||||||
|
oldTime = GetTime(m_iPartSlot[legs]);
|
||||||
|
SetPartAnim(legsAnim, legs);
|
||||||
|
SetTime(m_iPartSlot[legs], oldTime);
|
||||||
|
} else {
|
||||||
|
SetPartAnim(legsAnim, legs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
currentState_Legs = laststate_Legs;
|
currentState_Legs = laststate_Legs;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue