aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/server/waterbullet.cpp
diff options
context:
space:
mode:
authorJørgen P. Tjernø <[email protected]>2013-12-02 19:31:46 -0800
committerJørgen P. Tjernø <[email protected]>2013-12-02 19:46:31 -0800
commitf56bb35301836e56582a575a75864392a0177875 (patch)
treede61ddd39de3e7df52759711950b4c288592f0dc /mp/src/game/server/waterbullet.cpp
parentMark some more files as text. (diff)
downloadsource-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz
source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip
Fix line endings. WHAMMY.
Diffstat (limited to 'mp/src/game/server/waterbullet.cpp')
-rw-r--r--mp/src/game/server/waterbullet.cpp214
1 files changed, 107 insertions, 107 deletions
diff --git a/mp/src/game/server/waterbullet.cpp b/mp/src/game/server/waterbullet.cpp
index 904867ea..d5e726f3 100644
--- a/mp/src/game/server/waterbullet.cpp
+++ b/mp/src/game/server/waterbullet.cpp
@@ -1,107 +1,107 @@
-//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose: An effect for a single bullet passing through a body of water.
-// The slug quickly decelerates, leaving a trail of bubbles behind it.
-//
-// TODO: make clientside
-//
-//=============================================================================//
-#include "cbase.h"
-#include "waterbullet.h"
-#include "ndebugoverlay.h"
-
-// memdbgon must be the last include file in a .cpp file!!!
-#include "tier0/memdbgon.h"
-
-#define WATERBULLET_INITIAL_SPEED 1000.0
-#define WATERBULLET_STOP_TIME 0.5 // how long it takes a bullet in water to come to a stop!
-
-#define WATERBULLET_DECAY ( WATERBULLET_INITIAL_SPEED / WATERBULLET_STOP_TIME )
-
-BEGIN_DATADESC( CWaterBullet )
-
- // Function Pointers
- DEFINE_FUNCTION( Touch ),
- DEFINE_FUNCTION( BulletThink ),
-
-END_DATADESC()
-
-LINK_ENTITY_TO_CLASS( waterbullet, CWaterBullet );
-
-IMPLEMENT_SERVERCLASS_ST( CWaterBullet, DT_WaterBullet )
-END_SEND_TABLE()
-
-//-----------------------------------------------------------------------------
-// Purpose:
-//-----------------------------------------------------------------------------
-void CWaterBullet::Precache()
-{
- PrecacheModel( "models/weapons/w_bullet.mdl" );
-}
-
-
-//-----------------------------------------------------------------------------
-// Purpose:
-//-----------------------------------------------------------------------------
-void CWaterBullet::Spawn( const Vector &vecOrigin, const Vector &vecDir )
-{
- Precache();
-
- SetSolid( SOLID_BBOX );
- SetModel( "models/weapons/w_bullet.mdl" );
- UTIL_SetSize( this, vec3_origin, vec3_origin );
-
- SetMoveType( MOVETYPE_FLY );
-
- SetGravity( 0.0 );
-
- QAngle angles;
- SetAbsOrigin( vecOrigin );
-
- SetAbsVelocity( vecDir * 1500.0f );
- VectorAngles( GetAbsVelocity(), angles );
- SetAbsAngles( angles );
-
- SetCollisionGroup( COLLISION_GROUP_DEBRIS );
- SetTouch( &CWaterBullet::Touch );
-
- SetThink( &CWaterBullet::BulletThink );
- SetNextThink( gpGlobals->curtime );
-}
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-void CWaterBullet::BulletThink()
-{
- //NDebugOverlay::Line( GetAbsOrigin(), GetAbsOrigin() - GetAbsVelocity() * 0.1, 255, 255, 255, false, 1 );
- SetNextThink( gpGlobals->curtime + 0.05 );
-
-/*
- QAngle angles = GetAbsAngles();
- angles.x += random->RandomInt( -6, 6 );
- angles.y += random->RandomInt( -6, 6 );
- SetAbsAngles( angles );
-*/
-
- Vector forward;
- AngleVectors( GetAbsAngles(), &forward );
- SetAbsVelocity( forward * 1500.0f );
-}
-
-//-----------------------------------------------------------------------------
-// Purpose:
-//-----------------------------------------------------------------------------
-void CWaterBullet::Touch( CBaseEntity *pOther )
-{
- Vector vecDir = GetAbsVelocity();
- float speed = VectorNormalize( vecDir );
-
- Vector vecStart = GetAbsOrigin() - ( vecDir * 8 );
- Vector vecEnd = GetAbsOrigin() + ( vecDir * speed );
-
- trace_t tr;
- UTIL_TraceLine( vecStart, vecEnd, MASK_SHOT, NULL, &tr );
- UTIL_ImpactTrace( &tr, DMG_BULLET );
-
- UTIL_Remove( this );
-}
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: An effect for a single bullet passing through a body of water.
+// The slug quickly decelerates, leaving a trail of bubbles behind it.
+//
+// TODO: make clientside
+//
+//=============================================================================//
+#include "cbase.h"
+#include "waterbullet.h"
+#include "ndebugoverlay.h"
+
+// memdbgon must be the last include file in a .cpp file!!!
+#include "tier0/memdbgon.h"
+
+#define WATERBULLET_INITIAL_SPEED 1000.0
+#define WATERBULLET_STOP_TIME 0.5 // how long it takes a bullet in water to come to a stop!
+
+#define WATERBULLET_DECAY ( WATERBULLET_INITIAL_SPEED / WATERBULLET_STOP_TIME )
+
+BEGIN_DATADESC( CWaterBullet )
+
+ // Function Pointers
+ DEFINE_FUNCTION( Touch ),
+ DEFINE_FUNCTION( BulletThink ),
+
+END_DATADESC()
+
+LINK_ENTITY_TO_CLASS( waterbullet, CWaterBullet );
+
+IMPLEMENT_SERVERCLASS_ST( CWaterBullet, DT_WaterBullet )
+END_SEND_TABLE()
+
+//-----------------------------------------------------------------------------
+// Purpose:
+//-----------------------------------------------------------------------------
+void CWaterBullet::Precache()
+{
+ PrecacheModel( "models/weapons/w_bullet.mdl" );
+}
+
+
+//-----------------------------------------------------------------------------
+// Purpose:
+//-----------------------------------------------------------------------------
+void CWaterBullet::Spawn( const Vector &vecOrigin, const Vector &vecDir )
+{
+ Precache();
+
+ SetSolid( SOLID_BBOX );
+ SetModel( "models/weapons/w_bullet.mdl" );
+ UTIL_SetSize( this, vec3_origin, vec3_origin );
+
+ SetMoveType( MOVETYPE_FLY );
+
+ SetGravity( 0.0 );
+
+ QAngle angles;
+ SetAbsOrigin( vecOrigin );
+
+ SetAbsVelocity( vecDir * 1500.0f );
+ VectorAngles( GetAbsVelocity(), angles );
+ SetAbsAngles( angles );
+
+ SetCollisionGroup( COLLISION_GROUP_DEBRIS );
+ SetTouch( &CWaterBullet::Touch );
+
+ SetThink( &CWaterBullet::BulletThink );
+ SetNextThink( gpGlobals->curtime );
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+void CWaterBullet::BulletThink()
+{
+ //NDebugOverlay::Line( GetAbsOrigin(), GetAbsOrigin() - GetAbsVelocity() * 0.1, 255, 255, 255, false, 1 );
+ SetNextThink( gpGlobals->curtime + 0.05 );
+
+/*
+ QAngle angles = GetAbsAngles();
+ angles.x += random->RandomInt( -6, 6 );
+ angles.y += random->RandomInt( -6, 6 );
+ SetAbsAngles( angles );
+*/
+
+ Vector forward;
+ AngleVectors( GetAbsAngles(), &forward );
+ SetAbsVelocity( forward * 1500.0f );
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+//-----------------------------------------------------------------------------
+void CWaterBullet::Touch( CBaseEntity *pOther )
+{
+ Vector vecDir = GetAbsVelocity();
+ float speed = VectorNormalize( vecDir );
+
+ Vector vecStart = GetAbsOrigin() - ( vecDir * 8 );
+ Vector vecEnd = GetAbsOrigin() + ( vecDir * speed );
+
+ trace_t tr;
+ UTIL_TraceLine( vecStart, vecEnd, MASK_SHOT, NULL, &tr );
+ UTIL_ImpactTrace( &tr, DMG_BULLET );
+
+ UTIL_Remove( this );
+}