Skip to content

Commit aea94b3

Browse files
authored
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 #797 (comment)
1 parent 3de9978 commit aea94b3

File tree

4 files changed

+11
-16
lines changed

4 files changed

+11
-16
lines changed

src/game/shared/tf/tf_player_shared.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12110,6 +12110,13 @@ bool CTFPlayer::CanJump() const
1211012110
if ( m_Shared.InCond( TF_COND_TAUNTING ) )
1211112111
return false;
1211212112

12113+
CTFWeaponBase *pActiveWeapon = m_Shared.GetActiveTFWeapon();
12114+
if ( pActiveWeapon )
12115+
{
12116+
if ( !pActiveWeapon->OwnerCanJump() )
12117+
return false;
12118+
}
12119+
1211312120
int iNoJump = 0;
1211412121
CALL_ATTRIB_HOOK_INT( iNoJump, no_jump );
1211512122

src/game/shared/tf/tf_weapon_compound_bow.cpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -654,19 +654,7 @@ void CTFCompoundBow::SetArrowAlight( bool bAlight )
654654
//-----------------------------------------------------------------------------
655655
// Purpose:
656656
//-----------------------------------------------------------------------------
657-
void CTFCompoundBow::SetInternalChargeBeginTime( float flChargeBeginTime )
657+
bool CTFCompoundBow::OwnerCanJump( void )
658658
{
659-
#ifdef GAME_DLL
660-
float flCurrentChargeBeginTime = GetInternalChargeBeginTime();
661-
if ( flCurrentChargeBeginTime == 0.f && flChargeBeginTime > 0.f )
662-
{
663-
DisableJump();
664-
}
665-
else if ( flCurrentChargeBeginTime > 0.f && flChargeBeginTime == 0.f )
666-
{
667-
EnableJump();
668-
}
669-
#endif // GAME_DLL
670-
671-
BaseClass::SetInternalChargeBeginTime( flChargeBeginTime );
659+
return GetInternalChargeBeginTime() == 0.f;
672660
}

src/game/shared/tf/tf_weapon_compound_bow.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ class CTFCompoundBow : public CTFPipebombLauncher
8989

9090
void SetArrowAlight( bool bAlight );
9191

92-
protected:
93-
virtual void SetInternalChargeBeginTime( float flChargeBeginTime ) OVERRIDE;
92+
bool OwnerCanJump( void );
9493

9594
private:
9695
#ifdef CLIENT_DLL

src/game/shared/tf/tf_weaponbase.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ class CTFWeaponBase : public CBaseCombatWeapon, public IHasOwner, public IHasGen
335335
void EnableDuck();
336336
void DisableDuck();
337337

338+
virtual bool OwnerCanJump( void ) { return true; }
338339
virtual bool OwnerCanTaunt( void ) { return true; }
339340
virtual bool CanBeCritBoosted( void );
340341
bool CanHaveRevengeCrits( void );

0 commit comments

Comments
 (0)