Allow the same torso animation to play again
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 15s

This allows replaying the same torso animation, like when activating a new weapon of the same weapon class
This commit is contained in:
smallmodel 2025-01-05 02:29:02 +01:00
parent 8801834804
commit b5875ae890
No known key found for this signature in database
GPG key ID: A96F163ED4891440

View file

@ -5420,6 +5420,13 @@ void Player::EvaluateState(State *forceTorso, State *forceLegs)
StopPartAnimating(torso);
animdone_Torso = true;
} else if (torsoAnim != "") {
if (torsoAnim == partAnim[torso]) {
// Fixed in OPM
// Stop the part if it's the same animation
// so the new animation can play and make some action
// like activate the new weapon.
StopPartAnimating(torso);
}
SetPartAnim(torsoAnim.c_str(), torso);
}
} else {
@ -5427,6 +5434,11 @@ void Player::EvaluateState(State *forceTorso, State *forceLegs)
StopPartAnimating(torso);
animdone_Torso = true;
} else if (torsoAnim != "") {
if (torsoAnim == partAnim[torso]) {
// Fixed in OPM
// See above
StopPartAnimating(torso);
}
SetPartAnim(torsoAnim.c_str(), torso);
}