FIX - pre-jump anims circuited by racing conditions with AGENT_CONTROL_FINISH_ANIM

meow-7.2.2
Trish_sl 2026-02-09 23:01:49 -05:00 committed by livie
parent 7a1d2fc457
commit 8c84f6016c
2 changed files with 19 additions and 1 deletions

View File

@ -474,6 +474,7 @@ LLAgent::LLAgent() :
mIgnorePrejump(false),
mAlwaysFly(false),
// </FS>
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);
// <FS:Ansariel> 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);
}
}
}

View File

@ -583,6 +583,7 @@ private:
void updateIgnorePrejump(const LLSD &data);
void updateFSAlwaysFly(const LLSD &data);
// </FS> Ignore prejump and always fly
F64 mLastJumpRequestTime;
//--------------------------------------------------------------------
// Animations