This commit is contained in:
FlaminSarge 2025-04-04 00:44:36 -07:00 committed by GitHub
commit 8bc6e09dc0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 27 deletions

View file

@ -1215,18 +1215,18 @@ bool CTFGameMovement::CheckJumpButton()
if ( !m_pTFPlayer->CanJump() )
return false;
// Check to see if the player is a scout.
bool bScout = m_pTFPlayer->GetPlayerClass()->IsClass( TF_CLASS_SCOUT );
// Check to see if the player can air dash
bool bCanAirDash = m_pTFPlayer->CanAirDash();
bool bAirDash = false;
bool bOnGround = ( player->GetGroundEntity() != NULL );
ToggleParachute();
// Cannot jump will ducked.
// Cannot jump while ducked.
if ( player->GetFlags() & FL_DUCKING )
{
// Let a scout do it.
bool bAllow = ( bScout && !bOnGround );
// Let airdash do it.
bool bAllow = ( bCanAirDash && !bOnGround );
if ( !bAllow )
return false;
@ -1241,10 +1241,10 @@ bool CTFGameMovement::CheckJumpButton()
return false;
// In air, so ignore jumps
// (unless you are a scout or ghost or parachute
// (unless airdash or ghost or parachute)
if ( !bOnGround )
{
if ( m_pTFPlayer->CanAirDash() )
if ( bCanAirDash )
{
bAirDash = true;
}

View file

@ -12732,36 +12732,29 @@ bool CTFPlayer::CanAirDash( void ) const
if ( m_Shared.InCond( TF_COND_HALLOWEEN_SPEED_BOOST ) )
return true;
bool bScout = GetPlayerClass()->IsClass( TF_CLASS_SCOUT );
if ( !bScout )
return false;
int iNoAirDash = 0;
CALL_ATTRIB_HOOK_INT( iNoAirDash, set_scout_doublejump_disabled );
int iDashCount = ( !iNoAirDash && GetPlayerClass()->IsClass( TF_CLASS_SCOUT ) ) ? tf_scout_air_dash_count.GetInt() : 0;
if ( m_Shared.InCond( TF_COND_SODAPOPPER_HYPE ) )
{
if ( m_Shared.GetAirDash() < 5 )
return true;
else
return false;
iDashCount += 4;
}
CALL_ATTRIB_HOOK_INT( iDashCount, air_dash_count )
CTFWeaponBase *pTFActiveWeapon = GetActiveTFWeapon();
int iDashCount = tf_scout_air_dash_count.GetInt();
CALL_ATTRIB_HOOK_INT_ON_OTHER( pTFActiveWeapon, iDashCount, air_dash_count );
if ( m_Shared.GetAirDash() >= iDashCount )
return false;
if ( pTFActiveWeapon )
{
// TODO(driller): Hack fix to restrict this to The Atomzier (currently the only item that uses this attribute) on what would be the third jump
float flTimeSinceDeploy = gpGlobals->curtime - pTFActiveWeapon->GetLastDeployTime();
if ( iDashCount >= 2 && m_Shared.GetAirDash() == 1 && flTimeSinceDeploy < 0.7f )
return false;
// (for Atomizer): enforce that the item providing this attribute must be fully deployed to provide the bonus jumps
if ( gpGlobals->curtime >= m_Shared.m_flFirstPrimaryAttack )
{
CALL_ATTRIB_HOOK_INT_ON_OTHER( pTFActiveWeapon, iDashCount, air_dash_count_from_weapon );
}
}
int iNoAirDash = 0;
CALL_ATTRIB_HOOK_INT( iNoAirDash, set_scout_doublejump_disabled );
if ( 1 == iNoAirDash )
if ( m_Shared.GetAirDash() >= iDashCount )
return false;
return true;