mirror of
https://github.com/ValveSoftware/source-sdk-2013.git
synced 2025-04-08 19:12:51 +00:00
Merge 74747f6fc3
into 0565403b15
This commit is contained in:
commit
644aeb4693
5 changed files with 33 additions and 10 deletions
|
@ -323,6 +323,14 @@ void CTFSniperRifle::HandleZooms( void )
|
|||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CTFSniperRifle::CanInspect() const
|
||||
{
|
||||
return BaseClass::CanInspect() && !IsZoomed() && m_flChargedDamage == 0.f;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -545,7 +553,7 @@ void CTFSniperRifle::ZoomIn( void )
|
|||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CTFSniperRifle::IsZoomed( void )
|
||||
bool CTFSniperRifle::IsZoomed( void ) const
|
||||
{
|
||||
CTFPlayer *pPlayer = GetTFPlayerOwner();
|
||||
|
||||
|
@ -1917,6 +1925,9 @@ void CTFSniperRifleClassic::ItemPostFrame( void )
|
|||
CreateSniperDot();
|
||||
pPlayer->ClearExpression();
|
||||
#endif
|
||||
// Stop inspecting and reset our animation.
|
||||
StopInspect();
|
||||
SendWeaponAnim( ACT_VM_IDLE );
|
||||
}
|
||||
|
||||
float fSniperRifleChargePerSec = m_flChargePerSec;
|
||||
|
|
|
@ -117,6 +117,8 @@ public:
|
|||
|
||||
virtual void WeaponReset( void );
|
||||
|
||||
virtual bool CanInspect() const OVERRIDE;
|
||||
|
||||
virtual bool CanFireCriticalShot( bool bIsHeadshot = false, CBaseEntity *pTarget = NULL ) OVERRIDE;
|
||||
|
||||
virtual void PlayWeaponShootSound( void );
|
||||
|
@ -130,7 +132,7 @@ public:
|
|||
virtual bool ShouldEjectBrass();
|
||||
#endif
|
||||
|
||||
bool IsZoomed( void );
|
||||
bool IsZoomed( void ) const;
|
||||
bool IsFullyCharged( void ) const; // have we been zoomed in long enough for our shot to do max damage
|
||||
|
||||
virtual void OnControlStunned( void );
|
||||
|
|
|
@ -346,8 +346,7 @@ CTFWeaponBase::CTFWeaponBase()
|
|||
m_eStrangeType = STRANGE_UNKNOWN;
|
||||
m_eStatTrakModuleType = MODULE_UNKNOWN;
|
||||
|
||||
m_flInspectAnimEndTime = -1.f;
|
||||
m_nInspectStage = INSPECT_INVALID;
|
||||
StopInspect();
|
||||
}
|
||||
|
||||
CTFWeaponBase::~CTFWeaponBase()
|
||||
|
@ -785,8 +784,7 @@ bool CTFWeaponBase::SendWeaponAnim( int iActivity )
|
|||
// allow other activity to override the inspect
|
||||
if ( !IsInspectActivity( iActivity ) )
|
||||
{
|
||||
m_flInspectAnimEndTime = -1.f;
|
||||
m_nInspectStage = INSPECT_INVALID;
|
||||
StopInspect();
|
||||
return BaseClass::SendWeaponAnim( iActivity );
|
||||
}
|
||||
|
||||
|
@ -2549,8 +2547,7 @@ void CTFWeaponBase::HandleInspect()
|
|||
// first time pressing inspecting key
|
||||
if ( !m_bInspecting && pPlayer->IsInspecting() )
|
||||
{
|
||||
m_nInspectStage = INSPECT_INVALID;
|
||||
m_flInspectAnimEndTime = -1.f;
|
||||
StopInspect();
|
||||
if ( SendWeaponAnim( GetInspectActivity( INSPECT_START ) ) )
|
||||
{
|
||||
m_flInspectAnimEndTime = gpGlobals->curtime + SequenceDuration();
|
||||
|
@ -2582,8 +2579,7 @@ void CTFWeaponBase::HandleInspect()
|
|||
}
|
||||
else if ( m_nInspectStage == INSPECT_END )
|
||||
{
|
||||
m_flInspectAnimEndTime = -1.f;
|
||||
m_nInspectStage = INSPECT_INVALID;
|
||||
StopInspect();
|
||||
SendWeaponAnim( ACT_VM_IDLE );
|
||||
}
|
||||
}
|
||||
|
@ -2592,6 +2588,15 @@ void CTFWeaponBase::HandleInspect()
|
|||
m_bInspecting = pPlayer->IsInspecting();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
void CTFWeaponBase::StopInspect()
|
||||
{
|
||||
m_flInspectAnimEndTime = -1.f;
|
||||
m_nInspectStage = INSPECT_INVALID;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -760,6 +760,7 @@ public:
|
|||
|
||||
virtual bool CanInspect() const { return true; }
|
||||
void HandleInspect();
|
||||
void StopInspect();
|
||||
|
||||
virtual void HookAttributes( void ) {};
|
||||
virtual void OnUpgraded( void ) { HookAttributes(); }
|
||||
|
|
|
@ -1050,6 +1050,10 @@ void CTFWeaponBaseGun::ZoomIn( void )
|
|||
if ( !pPlayer )
|
||||
return;
|
||||
|
||||
// Stop inspecting and reset our animation.
|
||||
StopInspect();
|
||||
SendWeaponAnim( ACT_VM_IDLE );
|
||||
|
||||
// Set the weapon zoom.
|
||||
// TODO: The weapon fov should be gotten from the script file.
|
||||
float fBaseZoom = TF_WEAPON_ZOOM_FOV;
|
||||
|
|
Loading…
Reference in a new issue