This commit is contained in:
Ashetf2 2025-04-02 23:17:34 -04:00 committed by GitHub
commit 82bebe1ffc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 60 additions and 0 deletions

View file

@ -272,6 +272,14 @@ bool CTFBuffItem::Holster( CBaseCombatWeapon *pSwitchingTo )
}
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
bool CTFBuffItem::CanInspect() const
{
return BaseClass::CanInspect() && !m_bPlayingHorn;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------

View file

@ -71,6 +71,8 @@ public:
void RaiseFlag( void );
virtual bool Holster( CBaseCombatWeapon *pSwitchingTo );
virtual bool CanInspect() const OVERRIDE;
virtual bool CanReload( void );

View file

@ -245,6 +245,11 @@ bool CTFWeaponFlameBall::HasFullCharge() const
return pOwner->m_Shared.GetItemChargeMeter( LOADOUT_POSITION_PRIMARY) >= 100.f;
}
bool CTFWeaponFlameBall::CanInspect() const
{
return BaseClass::CanInspect() && HasFullCharge();
}
void CTFWeaponFlameBall::ItemPostFrame( void )
{
CTFPlayer *pOwner = ToTFPlayer( GetPlayerOwner() );

View file

@ -54,6 +54,8 @@ public:
virtual void OnResourceMeterFilled() OVERRIDE;
virtual float GetMeterMultiplier() const OVERRIDE;
virtual bool CanInspect() const OVERRIDE;
#ifdef GAME_DLL
virtual float GetInitialAfterburnDuration() const OVERRIDE { return 0.f; }

View file

@ -509,6 +509,14 @@ void CTFFlameThrower::UpdateOnRemove( void )
BaseClass::UpdateOnRemove();
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
bool CTFFlameThrower::CanInspect() const
{
return BaseClass::CanInspect() && !IsFiring();
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------

View file

@ -111,6 +111,8 @@ public:
bool EffectMeterShouldFlash( void );
virtual bool Deploy( void ) OVERRIDE;
virtual bool CanInspect() const OVERRIDE;
#if defined( CLIENT_DLL )

View file

@ -545,6 +545,16 @@ float CTFGrenadeLauncher::GetChargeMaxTime( void )
return GetMortarDetonateTimeLength();
}
bool CTFGrenadeLauncher::CanInspect() const
{
// we are charging a ball, so don't inspect
if ( m_flDetonateTime > gpGlobals->curtime )
{
return false;
}
return BaseClass::CanInspect();
}
void CTFGrenadeLauncher::ResetDetonateTime()
{

View file

@ -69,6 +69,8 @@ public:
virtual bool CanCharge( void );
virtual float GetChargeBeginTime( void );
virtual float GetChargeMaxTime( void );
virtual bool CanInspect() const OVERRIDE;
void LaunchGrenade( void );

View file

@ -2047,6 +2047,7 @@ bool CTFWeaponBase::ReloadSingly( void )
{
if ( SendWeaponAnim( ACT_RELOAD_FINISH ) )
{
m_flTimeFinishReloadSingly = gpGlobals->curtime + SequenceDuration();
// We're done, allow primary attack as soon as we like unless we're an energy weapon.
// if ( IsEnergyWeapon() )
// {
@ -2549,6 +2550,24 @@ void CTFWeaponBase::HandleInspect()
// first time pressing inspecting key
if ( !m_bInspecting && pPlayer->IsInspecting() )
{
// Don't inspect while reloading or zooming. TF_COND_ZOOMED for the Classic
if ( IsReloading() || pPlayer->m_Shared.InCond( TF_COND_AIMING ) || pPlayer->m_Shared.InCond( TF_COND_ZOOMED ) )
{
return;
}
// Don't inspect if the player has just fired
if ( gpGlobals->curtime < m_flNextPrimaryAttack )
{
return;
}
// Don't inspect if the weapon isn't idle after reloading last bullet
if ( gpGlobals->curtime < m_flTimeFinishReloadSingly )
{
return;
}
m_nInspectStage = INSPECT_INVALID;
m_flInspectAnimEndTime = -1.f;
if ( SendWeaponAnim( GetInspectActivity( INSPECT_START ) ) )

View file

@ -705,6 +705,8 @@ protected:
int m_iLastCritCheckFrame;
int m_iCurrentSeed;
float m_flLastRapidFireCritCheckTime;
float m_flTimeFinishReloadSingly;
float m_flLastDeployTime;