From 8c84f6016c89dbf8cff2deec08311fd4444cabd5 Mon Sep 17 00:00:00 2001 From: Trish_sl Date: Mon, 9 Feb 2026 23:01:49 -0500 Subject: [PATCH] FIX - pre-jump anims circuited by racing conditions with AGENT_CONTROL_FINISH_ANIM --- indra/newview/llagent.cpp | 19 ++++++++++++++++++- indra/newview/llagent.h | 1 + 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 9bf752db19..b5dc40e955 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -474,6 +474,7 @@ LLAgent::LLAgent() : mIgnorePrejump(false), mAlwaysFly(false), // + mLastJumpRequestTime(0.0), mControlFlags(0x00000000), @@ -892,6 +893,10 @@ void LLAgent::moveUp(S32 direction) if (direction > 0) { + if (!getFlying()) + { + mLastJumpRequestTime = LLTimer::getTotalSeconds(); + } setControlFlags(AGENT_CONTROL_UP_POS | AGENT_CONTROL_FAST_UP); // Chalice Yao's crouch toggle gAgentCamera.resetView(true, false, true); @@ -3255,7 +3260,19 @@ void LLAgent::onAnimStop(const LLUUID& id) } else if (id == ANIM_AGENT_PRE_JUMP || id == ANIM_AGENT_LAND || id == ANIM_AGENT_MEDIUM_LAND) { - setControlFlags(AGENT_CONTROL_FINISH_ANIM); + // If the jump key is currently held, avoid forcing a finish-anim that can + // short-circuit the next pre-jump in cases of rapid successive jumps. + // Breaking change since v7 viewers or so, likely caused by https://github.com/FirestormViewer/phoenix-firestorm/commit/da87e8bd370ea079576f8b412a4ddb80c0715bd1 + // TODO: the real fix would be to discern which anim the viewer finished, but this requires simulator fixes. + const bool up_pos = (mControlFlags & AGENT_CONTROL_UP_POS) != 0; + const F64 now = LLTimer::getTotalSeconds(); + const F64 elapsed = now - mLastJumpRequestTime; + const bool recent_jump = (mLastJumpRequestTime > 0.0) && (elapsed < 1.0); + + if (!up_pos && !recent_jump) + { + setControlFlags(AGENT_CONTROL_FINISH_ANIM); + } } } diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index d05ec1b93d..802f3be1ce 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -583,6 +583,7 @@ private: void updateIgnorePrejump(const LLSD &data); void updateFSAlwaysFly(const LLSD &data); // Ignore prejump and always fly + F64 mLastJumpRequestTime; //-------------------------------------------------------------------- // Animations