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/basegrenade_timed.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/basegrenade_timed.cpp')
| -rw-r--r-- | mp/src/game/server/basegrenade_timed.cpp | 146 |
1 files changed, 73 insertions, 73 deletions
diff --git a/mp/src/game/server/basegrenade_timed.cpp b/mp/src/game/server/basegrenade_timed.cpp index 238a72d1..e22b47c4 100644 --- a/mp/src/game/server/basegrenade_timed.cpp +++ b/mp/src/game/server/basegrenade_timed.cpp @@ -1,73 +1,73 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
-#include "cbase.h"
-#include "basegrenade_shared.h"
-
-// memdbgon must be the last include file in a .cpp file!!!
-#include "tier0/memdbgon.h"
-
-class CBaseGrenadeTimed : public CBaseGrenade
-{
-public:
- DECLARE_CLASS( CBaseGrenadeTimed, CBaseGrenade );
-
- void Spawn( void );
- void Precache( void );
-};
-LINK_ENTITY_TO_CLASS( npc_handgrenade, CBaseGrenadeTimed );
-
-
-void CBaseGrenadeTimed::Spawn( void )
-{
- SetMoveType( MOVETYPE_FLYGRAVITY, MOVECOLLIDE_FLY_BOUNCE );
- SetSolid( SOLID_BBOX );
- SetCollisionGroup( COLLISION_GROUP_PROJECTILE );
- SetModel( "models/Weapons/w_grenade.mdl" );
-
- UTIL_SetSize(this, Vector( -4, -4, -4), Vector(4, 4, 4));
-
- QAngle angles;
- Vector vel = GetAbsVelocity();
-
- VectorAngles( vel, angles );
- SetLocalAngles( angles );
-
- SetTouch( &CBaseGrenadeTimed::BounceTouch ); // Bounce if touched
-
- // Take one second off of the desired detonation time and set the think to PreDetonate. PreDetonate
- // will insert a DANGER sound into the world sound list and delay detonation for one second so that
- // the grenade explodes after the exact amount of time specified in the call to ShootTimed().
-
- SetThink( &CBaseGrenadeTimed::TumbleThink );
- SetNextThink( gpGlobals->curtime + 0.1f );
-
- // if the delay is < 0.1 seconds, don't fly anywhere
- if ((m_flDetonateTime - gpGlobals->curtime) < 0.1)
- {
- SetNextThink( gpGlobals->curtime );
- SetAbsVelocity( vec3_origin );
- }
-
- // Tumble through the air
- // pGrenade->m_vecAngVelocity.x = -400;
- SetGravity(1.0); // Don't change or throw calculations will be off!
- SetFriction(0.8);
-
- m_flDamage = 100; // ????
-
- m_takedamage = DAMAGE_NO;
-}
-
-
-
-void CBaseGrenadeTimed::Precache( void )
-{
- BaseClass::Precache( );
-
- PrecacheModel("models/weapons/w_grenade.mdl");
-}
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#include "cbase.h" +#include "basegrenade_shared.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + +class CBaseGrenadeTimed : public CBaseGrenade +{ +public: + DECLARE_CLASS( CBaseGrenadeTimed, CBaseGrenade ); + + void Spawn( void ); + void Precache( void ); +}; +LINK_ENTITY_TO_CLASS( npc_handgrenade, CBaseGrenadeTimed ); + + +void CBaseGrenadeTimed::Spawn( void ) +{ + SetMoveType( MOVETYPE_FLYGRAVITY, MOVECOLLIDE_FLY_BOUNCE ); + SetSolid( SOLID_BBOX ); + SetCollisionGroup( COLLISION_GROUP_PROJECTILE ); + SetModel( "models/Weapons/w_grenade.mdl" ); + + UTIL_SetSize(this, Vector( -4, -4, -4), Vector(4, 4, 4)); + + QAngle angles; + Vector vel = GetAbsVelocity(); + + VectorAngles( vel, angles ); + SetLocalAngles( angles ); + + SetTouch( &CBaseGrenadeTimed::BounceTouch ); // Bounce if touched + + // Take one second off of the desired detonation time and set the think to PreDetonate. PreDetonate + // will insert a DANGER sound into the world sound list and delay detonation for one second so that + // the grenade explodes after the exact amount of time specified in the call to ShootTimed(). + + SetThink( &CBaseGrenadeTimed::TumbleThink ); + SetNextThink( gpGlobals->curtime + 0.1f ); + + // if the delay is < 0.1 seconds, don't fly anywhere + if ((m_flDetonateTime - gpGlobals->curtime) < 0.1) + { + SetNextThink( gpGlobals->curtime ); + SetAbsVelocity( vec3_origin ); + } + + // Tumble through the air + // pGrenade->m_vecAngVelocity.x = -400; + SetGravity(1.0); // Don't change or throw calculations will be off! + SetFriction(0.8); + + m_flDamage = 100; // ???? + + m_takedamage = DAMAGE_NO; +} + + + +void CBaseGrenadeTimed::Precache( void ) +{ + BaseClass::Precache( ); + + PrecacheModel("models/weapons/w_grenade.mdl"); +} |