mirror of
https://github.com/fortressforever/fortressforever-2013.git
synced 2024-11-25 22:01:26 +00:00
Fixed trimping not working with cl_jumpqueue 0 when holding jump continuously (from initial jump to touching the ramp)
This commit is contained in:
parent
53ce519f9c
commit
09be698c71
1 changed files with 19 additions and 9 deletions
|
@ -204,15 +204,29 @@ bool CFF_SH_GameMovement::CanJump( void )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool bUseJumpQueue;
|
||||||
|
#ifdef CLIENT_DLL
|
||||||
|
bUseJumpQueue = cl_jumpqueue.GetBool();
|
||||||
|
#else
|
||||||
|
bUseJumpQueue = (Q_atoi( engine->GetClientConVarValue( player->entindex(), "cl_jumpqueue" ) ) ) != 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
// No more effect
|
// No more effect
|
||||||
if (player->GetGroundEntity() == NULL)
|
if (player->GetGroundEntity() == NULL)
|
||||||
{
|
{
|
||||||
// FF --> Allow holding jump in the air to make you jump when you land
|
// FF --> Allow holding jump in the air to make you jump when you land
|
||||||
if(!(mv->m_nOldButtons & IN_JUMP))
|
if( bUseJumpQueue && !(mv->m_nOldButtons & IN_JUMP) )
|
||||||
{
|
{
|
||||||
// FF Port Note: For only allowing holding jump while in the downward part of a jump, do a (mv->m_vecVelocity[2] < 0.0f) check here
|
// FF Port Note: For only allowing holding jump while in the downward part of a jump, do a (mv->m_vecVelocity[2] < 0.0f) check here
|
||||||
|
// Jump wasn't held last frame, so act like jump isn't held for the rest of the airtime
|
||||||
|
// FF TODO: Potentially add a jump-specific button-held-state variable to handle jump queueing, since manipulating the button states directly is rather hacky
|
||||||
mv->m_nButtons &= ~IN_JUMP;
|
mv->m_nButtons &= ~IN_JUMP;
|
||||||
}
|
}
|
||||||
|
else if (!bUseJumpQueue)
|
||||||
|
{
|
||||||
|
// act like the jump key was never held last frame; this is needed because of how the trimping code interacts with the rampslide code
|
||||||
|
mv->m_nOldButtons &= ~IN_JUMP;
|
||||||
|
}
|
||||||
// FF <--
|
// FF <--
|
||||||
return false; // in air, so no effect
|
return false; // in air, so no effect
|
||||||
}
|
}
|
||||||
|
@ -223,13 +237,9 @@ bool CFF_SH_GameMovement::CanJump( void )
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CLIENT_DLL
|
// If jump queue is enabled and we have been holding jump since we last jumped, then don't allow jumping again until it's been released for at least one frame
|
||||||
if ( mv->m_nOldButtons & IN_JUMP && cl_jumpqueue.GetBool() )
|
if ( bUseJumpQueue && mv->m_nOldButtons & IN_JUMP )
|
||||||
return false; // don't pogo stick
|
return false; // don't pogo stick
|
||||||
#else
|
|
||||||
if ( mv->m_nOldButtons & IN_JUMP && (Q_atoi( engine->GetClientConVarValue( player->entindex(), "cl_jumpqueue" ) ) ) )
|
|
||||||
return false; // don't pogo stick
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue