Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/game/shared/tf/tf_player_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down
16 changes: 2 additions & 14 deletions src/game/shared/tf/tf_weapon_compound_bow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
3 changes: 1 addition & 2 deletions src/game/shared/tf/tf_weapon_compound_bow.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ class CTFCompoundBow : public CTFPipebombLauncher

void SetArrowAlight( bool bAlight );

protected:
virtual void SetInternalChargeBeginTime( float flChargeBeginTime ) OVERRIDE;
bool OwnerCanJump( void );

private:
#ifdef CLIENT_DLL
Expand Down
1 change: 1 addition & 0 deletions src/game/shared/tf/tf_weaponbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down