FIX - pre-jump anims circuited by racing conditions with AGENT_CONTROL_FINISH_ANIM
parent
7a1d2fc457
commit
8c84f6016c
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -583,6 +583,7 @@ private:
|
|||
void updateIgnorePrejump(const LLSD &data);
|
||||
void updateFSAlwaysFly(const LLSD &data);
|
||||
// </FS> Ignore prejump and always fly
|
||||
F64 mLastJumpRequestTime;
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Animations
|
||||
|
|
|
|||
Loading…
Reference in New Issue