aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/client/clientsideeffects.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/clientsideeffects.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/clientsideeffects.cpp')
-rw-r--r--mp/src/game/client/clientsideeffects.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/mp/src/game/client/clientsideeffects.cpp b/mp/src/game/client/clientsideeffects.cpp
index b9cb5f56..c7912e3b 100644
--- a/mp/src/game/client/clientsideeffects.cpp
+++ b/mp/src/game/client/clientsideeffects.cpp
@@ -69,6 +69,15 @@ const char *CClientSideEffect::GetName( void )
}
//-----------------------------------------------------------------------------
+// Purpose: Set the name of effect
+// Input : const char
+//-----------------------------------------------------------------------------
+void CClientSideEffect::SetEffectName( const char *pszName )
+{
+ m_pszName = pszName;
+}
+
+//-----------------------------------------------------------------------------
// Purpose: Is effect still active?
// Output : Returns true on success, false on failure.
//-----------------------------------------------------------------------------
@@ -99,6 +108,7 @@ public:
// Add an effect to the effects list
void AddEffect( CClientSideEffect *effect );
// Remove the specified effect
+ void RemoveEffect( CClientSideEffect *effect );
// Draw/update all effects in the current list
void DrawEffects( double frametime );
// Flush out all effects from the list
@@ -161,6 +171,23 @@ void CEffectsList::AddEffect( CClientSideEffect *effect )
}
//-----------------------------------------------------------------------------
+void CEffectsList::RemoveEffect( CClientSideEffect *effect )
+{
+ Assert( effect );
+ CClientSideEffect **end = &m_rgEffects[m_nEffects];
+ for( CClientSideEffect **p = &m_rgEffects[0]; p < end; ++p)
+ {
+ if ( *p == effect )
+ {
+ RemoveEffect( p - &m_rgEffects[0] ); // todo remove this crutch
+ return;
+ }
+ }
+
+ Assert( false ); // don't know this effect
+}
+
+//-----------------------------------------------------------------------------
// Purpose: Remove specified effect by index
// Input : effectIndex -
//-----------------------------------------------------------------------------