Skip to content

Commit 2eba8df

Browse files
committed
1 parent 778dffa commit 2eba8df

10 files changed

+82
-0
lines changed

src/game/shared/tf/tf_weapon_buff_item.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,16 @@ bool CTFBuffItem::Holster( CBaseCombatWeapon *pSwitchingTo )
272272
}
273273
}
274274

275+
#ifdef BDSBASE
276+
//-----------------------------------------------------------------------------
277+
// Purpose:
278+
//-----------------------------------------------------------------------------
279+
bool CTFBuffItem::CanInspect() const
280+
{
281+
return BaseClass::CanInspect() && !m_bPlayingHorn;
282+
}
283+
#endif
284+
275285
//-----------------------------------------------------------------------------
276286
// Purpose:
277287
//-----------------------------------------------------------------------------

src/game/shared/tf/tf_weapon_buff_item.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ class CTFBuffItem : public CTFWeaponBaseMelee
7272

7373
virtual bool Holster( CBaseCombatWeapon *pSwitchingTo );
7474

75+
#ifdef BDSBASE
76+
virtual bool CanInspect() const OVERRIDE;
77+
#endif
78+
7579
virtual bool CanReload( void );
7680

7781
virtual int GetBuffType() { int iBuffType = 0; CALL_ATTRIB_HOOK_INT( iBuffType, set_buff_type ); return iBuffType; }

src/game/shared/tf/tf_weapon_dragons_fury.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,13 @@ bool CTFWeaponFlameBall::HasFullCharge() const
245245
return pOwner->m_Shared.GetItemChargeMeter( LOADOUT_POSITION_PRIMARY) >= 100.f;
246246
}
247247

248+
#ifdef BDSBASE
249+
bool CTFWeaponFlameBall::CanInspect() const
250+
{
251+
return BaseClass::CanInspect() && HasFullCharge();
252+
}
253+
#endif
254+
248255
void CTFWeaponFlameBall::ItemPostFrame( void )
249256
{
250257
CTFPlayer *pOwner = ToTFPlayer( GetPlayerOwner() );

src/game/shared/tf/tf_weapon_dragons_fury.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ class CTFWeaponFlameBall : public CTFFlameThrower
5555
virtual void OnResourceMeterFilled() OVERRIDE;
5656
virtual float GetMeterMultiplier() const OVERRIDE;
5757

58+
#ifdef BDSBASE
59+
virtual bool CanInspect() const OVERRIDE;
60+
#endif
61+
5862
#ifdef GAME_DLL
5963
virtual float GetInitialAfterburnDuration() const OVERRIDE { return 0.f; }
6064
void RefundAmmo( int nAmmo );

src/game/shared/tf/tf_weapon_flamethrower.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,16 @@ void CTFFlameThrower::UpdateOnRemove( void )
509509
BaseClass::UpdateOnRemove();
510510
}
511511

512+
#ifdef BDSBASE
513+
//-----------------------------------------------------------------------------
514+
// Purpose:
515+
//-----------------------------------------------------------------------------
516+
bool CTFFlameThrower::CanInspect() const
517+
{
518+
return BaseClass::CanInspect() && !IsFiring();
519+
}
520+
#endif
521+
512522
//-----------------------------------------------------------------------------
513523
// Purpose:
514524
//-----------------------------------------------------------------------------

src/game/shared/tf/tf_weapon_flamethrower.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ class CTFFlameThrower : public CTFWeaponBaseGun
112112

113113
virtual bool Deploy( void ) OVERRIDE;
114114

115+
#ifdef BDSBASE
116+
virtual bool CanInspect() const OVERRIDE;
117+
#endif
118+
115119
#if defined( CLIENT_DLL )
116120

117121
virtual void OnDataChanged(DataUpdateType_t updateType) OVERRIDE;

src/game/shared/tf/tf_weapon_grenadelauncher.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,18 @@ float CTFGrenadeLauncher::GetChargeMaxTime( void )
545545
return GetMortarDetonateTimeLength();
546546
}
547547

548+
#ifdef BDSBASE
549+
bool CTFGrenadeLauncher::CanInspect() const
550+
{
551+
// we are charging a ball, so don't inspect
552+
if (m_flDetonateTime > gpGlobals->curtime)
553+
{
554+
return false;
555+
}
556+
557+
return BaseClass::CanInspect();
558+
}
559+
#endif
548560

549561
void CTFGrenadeLauncher::ResetDetonateTime()
550562
{

src/game/shared/tf/tf_weapon_grenadelauncher.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ class CTFGrenadeLauncher : public CTFWeaponBaseGun, public ITFChargeUpWeapon
7070
virtual float GetChargeBeginTime( void );
7171
virtual float GetChargeMaxTime( void );
7272

73+
#ifdef BDSBASE
74+
virtual bool CanInspect() const OVERRIDE;
75+
#endif
76+
7377
void LaunchGrenade( void );
7478

7579
void AddDonkVictim( const CBaseEntity* pVictim );

src/game/shared/tf/tf_weaponbase.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2062,6 +2062,9 @@ bool CTFWeaponBase::ReloadSingly( void )
20622062
{
20632063
if ( SendWeaponAnim( ACT_RELOAD_FINISH ) )
20642064
{
2065+
#ifdef BDSBASE
2066+
m_flTimeFinishReloadSingly = gpGlobals->curtime + SequenceDuration();
2067+
#endif
20652068
// We're done, allow primary attack as soon as we like unless we're an energy weapon.
20662069
// if ( IsEnergyWeapon() )
20672070
// {
@@ -2591,6 +2594,26 @@ void CTFWeaponBase::HandleInspect()
25912594
// first time pressing inspecting key
25922595
if ( !m_bInspecting && pPlayer->IsInspecting() )
25932596
{
2597+
#ifdef BDSBASE
2598+
// Don't inspect while reloading or zooming. TF_COND_ZOOMED for the Classic
2599+
if (IsReloading() || pPlayer->m_Shared.InCond(TF_COND_AIMING) || pPlayer->m_Shared.InCond(TF_COND_ZOOMED))
2600+
{
2601+
return;
2602+
}
2603+
2604+
// Don't inspect if the player has just fired
2605+
if (gpGlobals->curtime < m_flNextPrimaryAttack)
2606+
{
2607+
return;
2608+
}
2609+
2610+
// Don't inspect if the weapon isn't idle after reloading last bullet
2611+
if (gpGlobals->curtime < m_flTimeFinishReloadSingly)
2612+
{
2613+
return;
2614+
}
2615+
#endif
2616+
25942617
m_nInspectStage = INSPECT_INVALID;
25952618
m_flInspectAnimEndTime = -1.f;
25962619
if ( SendWeaponAnim( GetInspectActivity( INSPECT_START ) ) )

src/game/shared/tf/tf_weaponbase.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,10 @@ class CTFWeaponBase : public CBaseCombatWeapon, public IHasOwner, public IHasGen
725725
int m_iCurrentSeed;
726726
float m_flLastRapidFireCritCheckTime;
727727

728+
#ifdef BDSBASE
729+
float m_flTimeFinishReloadSingly;
730+
#endif
731+
728732
float m_flLastDeployTime;
729733

730734
char m_szTracerName[MAX_TRACER_NAME];

0 commit comments

Comments
 (0)