tf2: Fix prediction for jumping when huntsman is charged/released (#797)

* fix prediction for jumping when huntsman is charged/released

* remove SetInternalChargeBeginTime override from CTFCompoundBow

https://github.com/ValveSoftware/source-sdk-2013/pull/797#discussion_r1970597141
This commit is contained in:
wget 2025-02-27 09:06:34 +08:00 committed by GitHub
parent 3de9978bb9
commit aea94b32cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 11 additions and 16 deletions

View File

@ -12110,6 +12110,13 @@ bool CTFPlayer::CanJump() const
if ( m_Shared.InCond( TF_COND_TAUNTING ) ) if ( m_Shared.InCond( TF_COND_TAUNTING ) )
return false; return false;
CTFWeaponBase *pActiveWeapon = m_Shared.GetActiveTFWeapon();
if ( pActiveWeapon )
{
if ( !pActiveWeapon->OwnerCanJump() )
return false;
}
int iNoJump = 0; int iNoJump = 0;
CALL_ATTRIB_HOOK_INT( iNoJump, no_jump ); CALL_ATTRIB_HOOK_INT( iNoJump, no_jump );

View File

@ -654,19 +654,7 @@ void CTFCompoundBow::SetArrowAlight( bool bAlight )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Purpose: // Purpose:
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void CTFCompoundBow::SetInternalChargeBeginTime( float flChargeBeginTime ) bool CTFCompoundBow::OwnerCanJump( void )
{ {
#ifdef GAME_DLL return GetInternalChargeBeginTime() == 0.f;
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 );
} }

View File

@ -89,8 +89,7 @@ public:
void SetArrowAlight( bool bAlight ); void SetArrowAlight( bool bAlight );
protected: bool OwnerCanJump( void );
virtual void SetInternalChargeBeginTime( float flChargeBeginTime ) OVERRIDE;
private: private:
#ifdef CLIENT_DLL #ifdef CLIENT_DLL

View File

@ -335,6 +335,7 @@ class CTFWeaponBase : public CBaseCombatWeapon, public IHasOwner, public IHasGen
void EnableDuck(); void EnableDuck();
void DisableDuck(); void DisableDuck();
virtual bool OwnerCanJump( void ) { return true; }
virtual bool OwnerCanTaunt( void ) { return true; } virtual bool OwnerCanTaunt( void ) { return true; }
virtual bool CanBeCritBoosted( void ); virtual bool CanBeCritBoosted( void );
bool CanHaveRevengeCrits( void ); bool CanHaveRevengeCrits( void );