summaryrefslogtreecommitdiff
path: root/indra/newview/llagent.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <118752495+marchcat@users.noreply.github.com>2026-05-21 20:03:14 +0300
committerGitHub <noreply@github.com>2026-05-21 20:03:14 +0300
commit627bb8feff264a6077dcf435e5656145d566e94a (patch)
tree55af7639161926313434d9e4a8b9872369668d5d /indra/newview/llagent.cpp
parentff536adef0b74c20f55bd501ad593e4eef762082 (diff)
parent15d82beb6056fa16a1ea1cbf01c5d673a95e0267 (diff)
Merge pull request #5852 from secondlife/marchcat/slua-26.2
26.2 -> SLua viewer
Diffstat (limited to 'indra/newview/llagent.cpp')
-rw-r--r--indra/newview/llagent.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 60af0cad05..3ab87cac13 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -426,6 +426,7 @@ LLAgent::LLAgent() :
mIsDoNotDisturb(false),
mControlFlags(0x00000000),
+ mLastJumpInputTime(0.0),
mAutoPilot(false),
mAutoPilotFlyOnStop(false),
@@ -780,6 +781,10 @@ void LLAgent::moveUp(S32 direction)
if (direction > 0)
{
+ if (!getFlying())
+ {
+ mLastJumpInputTime = LLTimer::getTotalSeconds();
+ }
setControlFlags(AGENT_CONTROL_UP_POS | AGENT_CONTROL_FAST_UP);
}
else if (direction < 0)
@@ -2663,7 +2668,21 @@ 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);
+ // 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 - mLastJumpInputTime;
+ static LLCachedControl<F32> recent_jump_threshold_secs(gSavedSettings, "RecentJumpThresholdSecs");
+ const bool recent_jump = (mLastJumpInputTime > 0.0) && (elapsed < recent_jump_threshold_secs);
+
+ if (!up_pos && !recent_jump)
+ {
+ setControlFlags(AGENT_CONTROL_FINISH_ANIM);
+ }
}
}