From 7e9cc1a55a89650066aa2081d2d895d1b10a0b5b Mon Sep 17 00:00:00 2001 From: Trish Date: Wed, 11 Feb 2026 02:49:18 -0500 Subject: [PATCH 1/4] FIX - prejump bug --- indra/newview/llagent.cpp | 20 +++++++++++++++++++- indra/newview/llagent.h | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 60af0cad05a..71883c8f423 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -425,6 +425,8 @@ LLAgent::LLAgent() : mIsDoNotDisturb(false), + mLastJumpRequestTime(0.0), + mControlFlags(0x00000000), mAutoPilot(false), @@ -677,6 +679,10 @@ void LLAgent::moveAt(S32 direction, bool reset) if (direction > 0) { + if (!getFlying()) + { + mLastJumpRequestTime = LLTimer::getTotalSeconds(); + } setControlFlags(AGENT_CONTROL_AT_POS | AGENT_CONTROL_FAST_AT); } else if (direction < 0) @@ -2663,7 +2669,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. + // Bug amplified 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 3352890d999..a62c915ff14 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -487,6 +487,7 @@ class LLAgent : public LLOldEvents::LLObservable S32 mControlsTakenCount[TOTAL_CONTROLS]; S32 mControlsTakenPassedOnCount[TOTAL_CONTROLS]; U32 mControlFlags; // Replacement for the mFooKey's + F64 mLastJumpRequestTime; //-------------------------------------------------------------------- // Animations From 2cabd41943c8d14bc72b52f1891671b28d0a856a Mon Sep 17 00:00:00 2001 From: Trish Date: Wed, 11 Feb 2026 10:16:58 -0500 Subject: [PATCH 2/4] fix - copilot suggestions --- indra/newview/llagent.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 71883c8f423..c559c0641a3 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -115,6 +115,7 @@ const F32 AUTOPILOT_MAX_TIME_NO_PROGRESS_FLY = 2.5f; // seconds. Flying i const F32 MAX_VELOCITY_AUTO_LAND_SQUARED = 4.f * 4.f; const F64 CHAT_AGE_FAST_RATE = 3.0; +const F64 RECENT_JUMP_THRESHOLD_SECS = 1.0; // seconds // fidget constants const F32 MIN_FIDGET_TIME = 8.f; // seconds @@ -425,9 +426,8 @@ LLAgent::LLAgent() : mIsDoNotDisturb(false), - mLastJumpRequestTime(0.0), - mControlFlags(0x00000000), + mLastJumpRequestTime(0.0), mAutoPilot(false), mAutoPilotFlyOnStop(false), @@ -679,10 +679,6 @@ void LLAgent::moveAt(S32 direction, bool reset) if (direction > 0) { - if (!getFlying()) - { - mLastJumpRequestTime = LLTimer::getTotalSeconds(); - } setControlFlags(AGENT_CONTROL_AT_POS | AGENT_CONTROL_FAST_AT); } else if (direction < 0) @@ -786,6 +782,10 @@ void LLAgent::moveUp(S32 direction) if (direction > 0) { + if (!getFlying()) + { + mLastJumpRequestTime = LLTimer::getTotalSeconds(); + } setControlFlags(AGENT_CONTROL_UP_POS | AGENT_CONTROL_FAST_UP); } else if (direction < 0) @@ -2676,7 +2676,7 @@ void LLAgent::onAnimStop(const LLUUID& id) 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); + const bool recent_jump = (mLastJumpRequestTime > 0.0) && (elapsed < RECENT_JUMP_THRESHOLD_SECS); if (!up_pos && !recent_jump) { From 77f534e344092cdd8a602e3f30d421f8fea7a0c0 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy <118752495+marchcat@users.noreply.github.com> Date: Wed, 11 Feb 2026 18:38:24 +0200 Subject: [PATCH 3/4] Update comment in indra/newview/llagent.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- indra/newview/llagent.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index a62c915ff14..4eac3357aa9 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -487,7 +487,7 @@ class LLAgent : public LLOldEvents::LLObservable S32 mControlsTakenCount[TOTAL_CONTROLS]; S32 mControlsTakenPassedOnCount[TOTAL_CONTROLS]; U32 mControlFlags; // Replacement for the mFooKey's - F64 mLastJumpRequestTime; + F64 mLastJumpRequestTime; // Time of last jump request in seconds from LLTimer::getTotalSeconds() //-------------------------------------------------------------------- // Animations From 2a9c1984e2b9cc5d1f88d1d2ba280668fa3aa5dc Mon Sep 17 00:00:00 2001 From: Trish Date: Wed, 11 Feb 2026 12:15:46 -0500 Subject: [PATCH 4/4] fix - threshold as debug setting & comment & flag label --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llagent.cpp | 17 +++++++++-------- indra/newview/llagent.h | 2 +- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index d81756f6477..27bcc1c1fc9 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -489,6 +489,17 @@ Value 1 + RecentJumpThresholdSecs + + Comment + Seconds after a jump input during which finish-anim is suppressed to avoid interrupting rapid successive jumps. + Persist + 1 + Type + F32 + Value + 1.0 + AvatarAxisDeadZone0 Comment diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index c559c0641a3..e3f9debd2fa 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -115,7 +115,6 @@ const F32 AUTOPILOT_MAX_TIME_NO_PROGRESS_FLY = 2.5f; // seconds. Flying i const F32 MAX_VELOCITY_AUTO_LAND_SQUARED = 4.f * 4.f; const F64 CHAT_AGE_FAST_RATE = 3.0; -const F64 RECENT_JUMP_THRESHOLD_SECS = 1.0; // seconds // fidget constants const F32 MIN_FIDGET_TIME = 8.f; // seconds @@ -427,7 +426,7 @@ LLAgent::LLAgent() : mIsDoNotDisturb(false), mControlFlags(0x00000000), - mLastJumpRequestTime(0.0), + mLastJumpInputTime(0.0), mAutoPilot(false), mAutoPilotFlyOnStop(false), @@ -2669,14 +2668,16 @@ void LLAgent::onAnimStop(const LLUUID& id) } else if (id == ANIM_AGENT_PRE_JUMP || id == ANIM_AGENT_LAND || id == ANIM_AGENT_MEDIUM_LAND) { - // 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. - // Bug amplified 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. + // FIRE-34049/FIRE-34273/https://github.com/secondlife/viewer/issues/4218 + // Avoid forcing AGENT_CONTROL_FINISH_ANIM, which can short-circuit the next pre-jump + // during rapid successive jumps. + // TODO: a more robust fix would require knowing which specific animation finished, + // information that is not currently provided by the simulator. 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 < RECENT_JUMP_THRESHOLD_SECS); + const F64 elapsed = now - mLastJumpInputTime; + static LLCachedControl recent_jump_threshold_secs(gSavedSettings, "RecentJumpThresholdSecs"); + const bool recent_jump = (mLastJumpInputTime > 0.0) && (elapsed < recent_jump_threshold_secs); if (!up_pos && !recent_jump) { diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 4eac3357aa9..e6d9623957f 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -487,7 +487,7 @@ class LLAgent : public LLOldEvents::LLObservable S32 mControlsTakenCount[TOTAL_CONTROLS]; S32 mControlsTakenPassedOnCount[TOTAL_CONTROLS]; U32 mControlFlags; // Replacement for the mFooKey's - F64 mLastJumpRequestTime; // Time of last jump request in seconds from LLTimer::getTotalSeconds() + F64 mLastJumpInputTime; // Time of last jump input (key-down) in seconds from LLTimer::getTotalSeconds() //-------------------------------------------------------------------- // Animations