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),
|
mIgnorePrejump(false),
|
||||||
mAlwaysFly(false),
|
mAlwaysFly(false),
|
||||||
// </FS>
|
// </FS>
|
||||||
|
mLastJumpRequestTime(0.0),
|
||||||
|
|
||||||
mControlFlags(0x00000000),
|
mControlFlags(0x00000000),
|
||||||
|
|
||||||
|
|
@ -892,6 +893,10 @@ void LLAgent::moveUp(S32 direction)
|
||||||
|
|
||||||
if (direction > 0)
|
if (direction > 0)
|
||||||
{
|
{
|
||||||
|
if (!getFlying())
|
||||||
|
{
|
||||||
|
mLastJumpRequestTime = LLTimer::getTotalSeconds();
|
||||||
|
}
|
||||||
setControlFlags(AGENT_CONTROL_UP_POS | AGENT_CONTROL_FAST_UP);
|
setControlFlags(AGENT_CONTROL_UP_POS | AGENT_CONTROL_FAST_UP);
|
||||||
// <FS:Ansariel> Chalice Yao's crouch toggle
|
// <FS:Ansariel> Chalice Yao's crouch toggle
|
||||||
gAgentCamera.resetView(true, false, true);
|
gAgentCamera.resetView(true, false, true);
|
||||||
|
|
@ -3254,9 +3259,21 @@ void LLAgent::onAnimStop(const LLUUID& id)
|
||||||
sendAnimationRequest( ANIM_AGENT_BRUSH, ANIM_REQUEST_START );
|
sendAnimationRequest( ANIM_AGENT_BRUSH, ANIM_REQUEST_START );
|
||||||
}
|
}
|
||||||
else if (id == ANIM_AGENT_PRE_JUMP || id == ANIM_AGENT_LAND || id == ANIM_AGENT_MEDIUM_LAND)
|
else if (id == ANIM_AGENT_PRE_JUMP || id == ANIM_AGENT_LAND || id == ANIM_AGENT_MEDIUM_LAND)
|
||||||
|
{
|
||||||
|
// 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);
|
setControlFlags(AGENT_CONTROL_FINISH_ANIM);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LLAgent::isGodlike() const
|
bool LLAgent::isGodlike() const
|
||||||
|
|
|
||||||
|
|
@ -583,6 +583,7 @@ private:
|
||||||
void updateIgnorePrejump(const LLSD &data);
|
void updateIgnorePrejump(const LLSD &data);
|
||||||
void updateFSAlwaysFly(const LLSD &data);
|
void updateFSAlwaysFly(const LLSD &data);
|
||||||
// </FS> Ignore prejump and always fly
|
// </FS> Ignore prejump and always fly
|
||||||
|
F64 mLastJumpRequestTime;
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// Animations
|
// Animations
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue