aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/client/fx_tracer.cpp
diff options
context:
space:
mode:
authorJohn Schoenick <[email protected]>2015-09-09 18:35:41 -0700
committerJohn Schoenick <[email protected]>2015-09-09 18:35:41 -0700
commit0d8dceea4310fde5706b3ce1c70609d72a38efdf (patch)
treec831ef32c2c801a5c5a80401736b52c7b5a528ec /mp/src/game/client/fx_tracer.cpp
parentUpdated the SDK with the latest code from the TF and HL2 branches. (diff)
downloadsource-sdk-2013-master.tar.xz
source-sdk-2013-master.zip
Updated the SDK with the latest code from the TF and HL2 branches.HEADmaster
Diffstat (limited to 'mp/src/game/client/fx_tracer.cpp')
-rw-r--r--mp/src/game/client/fx_tracer.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/mp/src/game/client/fx_tracer.cpp b/mp/src/game/client/fx_tracer.cpp
index f0ca0e13..cec013a6 100644
--- a/mp/src/game/client/fx_tracer.cpp
+++ b/mp/src/game/client/fx_tracer.cpp
@@ -13,6 +13,9 @@
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
+ConVar r_drawtracers( "r_drawtracers", "1", FCVAR_CHEAT );
+ConVar r_drawtracers_firstperson( "r_drawtracers_firstperson", "1", FCVAR_ARCHIVE, "Toggle visibility of first person weapon tracers" );
+
#define TRACER_SPEED 5000
//-----------------------------------------------------------------------------
@@ -23,7 +26,7 @@ Vector GetTracerOrigin( const CEffectData &data )
Vector vecStart = data.m_vStart;
QAngle vecAngles;
- int iAttachment = data.m_nAttachmentIndex;;
+ int iAttachment = data.m_nAttachmentIndex;
// Attachment?
if ( data.m_fFlags & TRACER_FLAG_USEATTACHMENT )
@@ -77,6 +80,17 @@ void TracerCallback( const CEffectData &data )
if ( !player )
return;
+ if ( !r_drawtracers.GetBool() )
+ return;
+
+ if ( !r_drawtracers_firstperson.GetBool() )
+ {
+ C_BasePlayer *pPlayer = dynamic_cast<C_BasePlayer*>( data.GetEntity() );
+
+ if ( pPlayer && !pPlayer->ShouldDrawThisPlayer() )
+ return;
+ }
+
// Grab the data
Vector vecStart = GetTracerOrigin( data );
float flVelocity = data.m_flScale;
@@ -120,6 +134,17 @@ void ParticleTracerCallback( const CEffectData &data )
if ( !player )
return;
+ if ( !r_drawtracers.GetBool() )
+ return;
+
+ if ( !r_drawtracers_firstperson.GetBool() )
+ {
+ C_BasePlayer *pPlayer = dynamic_cast<C_BasePlayer*>( data.GetEntity() );
+
+ if ( pPlayer && !pPlayer->ShouldDrawThisPlayer() )
+ return;
+ }
+
// Grab the data
Vector vecStart = GetTracerOrigin( data );
Vector vecEnd = data.m_vOrigin;