diff options
| author | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:31:46 -0800 |
|---|---|---|
| committer | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:46:31 -0800 |
| commit | f56bb35301836e56582a575a75864392a0177875 (patch) | |
| tree | de61ddd39de3e7df52759711950b4c288592f0dc /mp/src/game/server/hl2/ar2_explosion.cpp | |
| parent | Mark some more files as text. (diff) | |
| download | source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip | |
Fix line endings. WHAMMY.
Diffstat (limited to 'mp/src/game/server/hl2/ar2_explosion.cpp')
| -rw-r--r-- | mp/src/game/server/hl2/ar2_explosion.cpp | 224 |
1 files changed, 112 insertions, 112 deletions
diff --git a/mp/src/game/server/hl2/ar2_explosion.cpp b/mp/src/game/server/hl2/ar2_explosion.cpp index 6479a039..53bc4637 100644 --- a/mp/src/game/server/hl2/ar2_explosion.cpp +++ b/mp/src/game/server/hl2/ar2_explosion.cpp @@ -1,112 +1,112 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-//=============================================================================//
-
-#include "cbase.h"
-#include "ar2_explosion.h"
-
-// memdbgon must be the last include file in a .cpp file!!!
-#include "tier0/memdbgon.h"
-
-#define AR2EXPLOSION_ENTITYNAME "ar2explosion"
-
-
-IMPLEMENT_SERVERCLASS_ST(AR2Explosion, DT_AR2Explosion)
- SendPropString( SENDINFO( m_szMaterialName ) ),
-END_SEND_TABLE()
-
-LINK_ENTITY_TO_CLASS(ar2explosion, AR2Explosion);
-
-
-//---------------------------------------------------------
-// Save/Restore
-//---------------------------------------------------------
-BEGIN_DATADESC( AR2Explosion )
-
- DEFINE_AUTO_ARRAY( m_szMaterialName, FIELD_CHARACTER ),
-
-END_DATADESC()
-
-
-AR2Explosion* AR2Explosion::CreateAR2Explosion(const Vector &pos)
-{
- CBaseEntity *pEnt = CreateEntityByName(AR2EXPLOSION_ENTITYNAME);
- if(pEnt)
- {
- AR2Explosion *pEffect = dynamic_cast<AR2Explosion*>(pEnt);
- if(pEffect && pEffect->edict())
- {
- pEffect->SetLocalOrigin( pos );
- pEffect->Activate();
- return pEffect;
- }
- else
- {
- UTIL_Remove(pEnt);
- }
- }
-
- return NULL;
-}
-
-
-//-----------------------------------------------------------------------------
-// A lightweight entity for level-designer placed AR2 explosions.
-//-----------------------------------------------------------------------------
-class CEnvAR2Explosion : public CPointEntity
-{
-public:
- DECLARE_CLASS( CEnvAR2Explosion, CPointEntity );
-
- void Spawn( void );
-
- // Input handlers
- void InputExplode( inputdata_t &inputdata );
-
- DECLARE_DATADESC();
-
-private:
-
- string_t m_iszMaterialName;
-};
-
-
-BEGIN_DATADESC( CEnvAR2Explosion )
- DEFINE_INPUTFUNC(FIELD_VOID, "Explode", InputExplode),
- DEFINE_KEYFIELD(m_iszMaterialName, FIELD_STRING, "material"),
-END_DATADESC()
-
-LINK_ENTITY_TO_CLASS( env_ar2explosion, CEnvAR2Explosion );
-
-
-//-----------------------------------------------------------------------------
-// Purpose: So you can see where this function begins and the last one ends.
-//-----------------------------------------------------------------------------
-void CEnvAR2Explosion::Spawn( void )
-{
- Precache();
-
- SetSolid( SOLID_NONE );
- AddEffects( EF_NODRAW );
-
- SetMoveType( MOVETYPE_NONE );
-}
-
-
-//-----------------------------------------------------------------------------
-// Purpose: Creates the explosion effect.
-//-----------------------------------------------------------------------------
-void CEnvAR2Explosion::InputExplode( inputdata_t &inputdata )
-{
- AR2Explosion *pExplosion = AR2Explosion::CreateAR2Explosion(GetAbsOrigin());
- if (pExplosion)
- {
- pExplosion->SetLifetime( 10 );
- if (m_iszMaterialName != NULL_STRING)
- {
- pExplosion->SetMaterialName(STRING(m_iszMaterialName));
- }
- }
-}
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//=============================================================================// + +#include "cbase.h" +#include "ar2_explosion.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + +#define AR2EXPLOSION_ENTITYNAME "ar2explosion" + + +IMPLEMENT_SERVERCLASS_ST(AR2Explosion, DT_AR2Explosion) + SendPropString( SENDINFO( m_szMaterialName ) ), +END_SEND_TABLE() + +LINK_ENTITY_TO_CLASS(ar2explosion, AR2Explosion); + + +//--------------------------------------------------------- +// Save/Restore +//--------------------------------------------------------- +BEGIN_DATADESC( AR2Explosion ) + + DEFINE_AUTO_ARRAY( m_szMaterialName, FIELD_CHARACTER ), + +END_DATADESC() + + +AR2Explosion* AR2Explosion::CreateAR2Explosion(const Vector &pos) +{ + CBaseEntity *pEnt = CreateEntityByName(AR2EXPLOSION_ENTITYNAME); + if(pEnt) + { + AR2Explosion *pEffect = dynamic_cast<AR2Explosion*>(pEnt); + if(pEffect && pEffect->edict()) + { + pEffect->SetLocalOrigin( pos ); + pEffect->Activate(); + return pEffect; + } + else + { + UTIL_Remove(pEnt); + } + } + + return NULL; +} + + +//----------------------------------------------------------------------------- +// A lightweight entity for level-designer placed AR2 explosions. +//----------------------------------------------------------------------------- +class CEnvAR2Explosion : public CPointEntity +{ +public: + DECLARE_CLASS( CEnvAR2Explosion, CPointEntity ); + + void Spawn( void ); + + // Input handlers + void InputExplode( inputdata_t &inputdata ); + + DECLARE_DATADESC(); + +private: + + string_t m_iszMaterialName; +}; + + +BEGIN_DATADESC( CEnvAR2Explosion ) + DEFINE_INPUTFUNC(FIELD_VOID, "Explode", InputExplode), + DEFINE_KEYFIELD(m_iszMaterialName, FIELD_STRING, "material"), +END_DATADESC() + +LINK_ENTITY_TO_CLASS( env_ar2explosion, CEnvAR2Explosion ); + + +//----------------------------------------------------------------------------- +// Purpose: So you can see where this function begins and the last one ends. +//----------------------------------------------------------------------------- +void CEnvAR2Explosion::Spawn( void ) +{ + Precache(); + + SetSolid( SOLID_NONE ); + AddEffects( EF_NODRAW ); + + SetMoveType( MOVETYPE_NONE ); +} + + +//----------------------------------------------------------------------------- +// Purpose: Creates the explosion effect. +//----------------------------------------------------------------------------- +void CEnvAR2Explosion::InputExplode( inputdata_t &inputdata ) +{ + AR2Explosion *pExplosion = AR2Explosion::CreateAR2Explosion(GetAbsOrigin()); + if (pExplosion) + { + pExplosion->SetLifetime( 10 ); + if (m_iszMaterialName != NULL_STRING) + { + pExplosion->SetMaterialName(STRING(m_iszMaterialName)); + } + } +} |