diff --git a/src/game/shared/tf/tf_player_shared.cpp b/src/game/shared/tf/tf_player_shared.cpp index 4da5c3df3..a2db00580 100644 --- a/src/game/shared/tf/tf_player_shared.cpp +++ b/src/game/shared/tf/tf_player_shared.cpp @@ -12110,6 +12110,13 @@ bool CTFPlayer::CanJump() const if ( m_Shared.InCond( TF_COND_TAUNTING ) ) return false; + CTFWeaponBase *pActiveWeapon = m_Shared.GetActiveTFWeapon(); + if ( pActiveWeapon ) + { + if ( !pActiveWeapon->OwnerCanJump() ) + return false; + } + int iNoJump = 0; CALL_ATTRIB_HOOK_INT( iNoJump, no_jump ); diff --git a/src/game/shared/tf/tf_weapon_compound_bow.cpp b/src/game/shared/tf/tf_weapon_compound_bow.cpp index 449329c79..768ae0845 100644 --- a/src/game/shared/tf/tf_weapon_compound_bow.cpp +++ b/src/game/shared/tf/tf_weapon_compound_bow.cpp @@ -654,19 +654,7 @@ void CTFCompoundBow::SetArrowAlight( bool bAlight ) //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- -void CTFCompoundBow::SetInternalChargeBeginTime( float flChargeBeginTime ) +bool CTFCompoundBow::OwnerCanJump( void ) { -#ifdef GAME_DLL - float flCurrentChargeBeginTime = GetInternalChargeBeginTime(); - if ( flCurrentChargeBeginTime == 0.f && flChargeBeginTime > 0.f ) - { - DisableJump(); - } - else if ( flCurrentChargeBeginTime > 0.f && flChargeBeginTime == 0.f ) - { - EnableJump(); - } -#endif // GAME_DLL - - BaseClass::SetInternalChargeBeginTime( flChargeBeginTime ); + return GetInternalChargeBeginTime() == 0.f; } diff --git a/src/game/shared/tf/tf_weapon_compound_bow.h b/src/game/shared/tf/tf_weapon_compound_bow.h index cbbbb9c74..a192166de 100644 --- a/src/game/shared/tf/tf_weapon_compound_bow.h +++ b/src/game/shared/tf/tf_weapon_compound_bow.h @@ -89,8 +89,7 @@ public: void SetArrowAlight( bool bAlight ); -protected: - virtual void SetInternalChargeBeginTime( float flChargeBeginTime ) OVERRIDE; + bool OwnerCanJump( void ); private: #ifdef CLIENT_DLL diff --git a/src/game/shared/tf/tf_weaponbase.h b/src/game/shared/tf/tf_weaponbase.h index bdf096343..d18638e59 100644 --- a/src/game/shared/tf/tf_weaponbase.h +++ b/src/game/shared/tf/tf_weaponbase.h @@ -335,6 +335,7 @@ class CTFWeaponBase : public CBaseCombatWeapon, public IHasOwner, public IHasGen void EnableDuck(); void DisableDuck(); + virtual bool OwnerCanJump( void ) { return true; } virtual bool OwnerCanTaunt( void ) { return true; } virtual bool CanBeCritBoosted( void ); bool CanHaveRevengeCrits( void );