Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
20 changes: 19 additions & 1 deletion indra/newview/llagent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Comment thread
trish-sl marked this conversation as resolved.
const F64 RECENT_JUMP_THRESHOLD_SECS = 1.0; // seconds

// fidget constants
const F32 MIN_FIDGET_TIME = 8.f; // seconds
Expand Down Expand Up @@ -426,6 +427,7 @@ LLAgent::LLAgent() :
mIsDoNotDisturb(false),

mControlFlags(0x00000000),
mLastJumpRequestTime(0.0),

Comment thread
trish-sl marked this conversation as resolved.
mAutoPilot(false),
mAutoPilotFlyOnStop(false),
Expand Down Expand Up @@ -780,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);
Comment thread
trish-sl marked this conversation as resolved.
}
else if (direction < 0)
Expand Down Expand Up @@ -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.
Comment thread
trish-sl marked this conversation as resolved.
Outdated
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);

Comment thread
trish-sl marked this conversation as resolved.
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 mLastJumpRequestTime;
Comment thread
marchcat marked this conversation as resolved.
Outdated

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