Skip to content
Open
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
5 changes: 5 additions & 0 deletions src/game/shared/tf/tf_weapon_dragons_fury.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
Expand Down
2 changes: 2 additions & 0 deletions src/game/shared/tf/tf_weapon_dragons_fury.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ class CTFWeaponFlameBall : public CTFFlameThrower
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; }
void RefundAmmo( int nAmmo );
Expand Down
8 changes: 8 additions & 0 deletions src/game/shared/tf/tf_weapon_flamethrower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,14 @@ void CTFFlameThrower::UpdateOnRemove( void )
BaseClass::UpdateOnRemove();
}

//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
bool CTFFlameThrower::CanInspect() const
{
return BaseClass::CanInspect() && !IsFiring();
}

//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions src/game/shared/tf/tf_weapon_flamethrower.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ class CTFFlameThrower : public CTFWeaponBaseGun
bool EffectMeterShouldFlash( void );

virtual bool Deploy( void ) OVERRIDE;
virtual bool CanInspect() const OVERRIDE;

#if defined( CLIENT_DLL )

Expand Down
10 changes: 10 additions & 0 deletions src/game/shared/tf/tf_weapon_grenadelauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
2 changes: 2 additions & 0 deletions src/game/shared/tf/tf_weapon_grenadelauncher.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ class CTFGrenadeLauncher : public CTFWeaponBaseGun, public ITFChargeUpWeapon
virtual float GetChargeBeginTime( void );
virtual float GetChargeMaxTime( void );

virtual bool CanInspect() const OVERRIDE;

void LaunchGrenade( void );

void AddDonkVictim( const CBaseEntity* pVictim );
Expand Down
20 changes: 20 additions & 0 deletions src/game/shared/tf/tf_weaponbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2068,8 +2068,10 @@ bool CTFWeaponBase::ReloadSingly( void )
case TF_RELOAD_FINISH:
default:
{
// we create a variable that tracks from curtime to the time + the duration of the finish reload activity
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() )
// {
Expand Down Expand Up @@ -2572,6 +2574,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 the last bullet
if ( gpGlobals->curtime < m_flTimeFinishReloadSingly )
{
return;
}

m_nInspectStage = INSPECT_INVALID;
m_flInspectAnimEndTime = -1.f;
if ( SendWeaponAnim( GetInspectActivity( INSPECT_START ) ) )
Expand Down
2 changes: 2 additions & 0 deletions src/game/shared/tf/tf_weaponbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,8 @@ class CTFWeaponBase : public CBaseCombatWeapon, public IHasOwner, public IHasGen
int m_iLastCritCheckFrame;
int m_iCurrentSeed;
float m_flLastRapidFireCritCheckTime;

float m_flTimeFinishReloadSingly; // tc2

float m_flLastDeployTime;
float m_flLastReadyTime;
Expand Down