mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Immediately cancel mount fidgets when movement starts
Fidget animations were continuing to play for a frame when movement started. Now forces immediate switch to run animation. Changes: - Check for movement + active fidget at start of animation logic - Force play run animation immediately to stop fidget - Only check fidget completion when not moving (optimization) - Removed duplicate mountActiveFidget_ = 0 in movement branch Fidgets now stop instantly when player starts moving on mount.
This commit is contained in:
parent
73db7768d4
commit
c91e0bb916
1 changed files with 11 additions and 4 deletions
|
|
@ -1089,8 +1089,15 @@ void Renderer::updateCharacterAnimation() {
|
|||
}
|
||||
}
|
||||
|
||||
// Check if active fidget has completed
|
||||
if (mountActiveFidget_ != 0) {
|
||||
// Cancel active fidget immediately if movement starts
|
||||
if (moving && mountActiveFidget_ != 0) {
|
||||
mountActiveFidget_ = 0;
|
||||
// Force play run animation to stop fidget immediately
|
||||
characterRenderer->playAnimation(mountInstanceId_, mountAnimId, true);
|
||||
}
|
||||
|
||||
// Check if active fidget has completed (only when not moving)
|
||||
if (!moving && mountActiveFidget_ != 0) {
|
||||
uint32_t curAnim = 0;
|
||||
float curTime = 0.0f, curDur = 0.0f;
|
||||
if (characterRenderer->getAnimationState(mountInstanceId_, curAnim, curTime, curDur)) {
|
||||
|
|
@ -1120,9 +1127,9 @@ void Renderer::updateCharacterAnimation() {
|
|||
|
||||
LOG_INFO("Mount idle fidget: playing anim ", fidgetAnim);
|
||||
}
|
||||
} else if (moving) {
|
||||
}
|
||||
if (moving) {
|
||||
mountIdleFidgetTimer_ = 0.0f; // Reset timer when moving
|
||||
mountActiveFidget_ = 0; // Cancel any active fidget
|
||||
}
|
||||
|
||||
// Idle ambient sounds: snorts and whinnies only, infrequent
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue