Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions indra/newview/app_settings/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,17 @@
<key>Value</key>
<integer>1</integer>
</map>
<key>RecentJumpThresholdSecs</key>
<map>
<key>Comment</key>
<string>Seconds after a jump input during which finish-anim is suppressed to avoid interrupting rapid successive jumps.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>1.0</real>
</map>
<key>AvatarAxisDeadZone0</key>
<map>
<key>Comment</key>
Expand Down
21 changes: 20 additions & 1 deletion indra/newview/llagent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ LLAgent::LLAgent() :
mIsDoNotDisturb(false),

mControlFlags(0x00000000),
mLastJumpInputTime(0.0),

mAutoPilot(false),
mAutoPilotFlyOnStop(false),
Expand Down Expand Up @@ -780,6 +781,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)
Expand Down Expand Up @@ -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);
}
}
}

Expand Down
1 change: 1 addition & 0 deletions indra/newview/llagent.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 mLastJumpInputTime; // Time of last jump input (key-down) in seconds from LLTimer::getTotalSeconds()

//--------------------------------------------------------------------
// Animations
Expand Down
Loading