summaryrefslogtreecommitdiff
path: root/game/server/te_impact.cpp
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/server/te_impact.cpp
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/server/te_impact.cpp')
-rw-r--r--game/server/te_impact.cpp97
1 files changed, 97 insertions, 0 deletions
diff --git a/game/server/te_impact.cpp b/game/server/te_impact.cpp
new file mode 100644
index 0000000..4f52ccc
--- /dev/null
+++ b/game/server/te_impact.cpp
@@ -0,0 +1,97 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: Send generic impact messages to the client for visualization
+//
+// $Workfile: $
+// $Date: $
+//
+//-----------------------------------------------------------------------------
+// $Log: $
+//
+// $NoKeywords: $
+//=============================================================================//
+#include "cbase.h"
+#include "basetempentity.h"
+
+// memdbgon must be the last include file in a .cpp file!!!
+#include "tier0/memdbgon.h"
+
+//-----------------------------------------------------------------------------
+// Purpose: Dispatches Gunshot decal tempentity
+//-----------------------------------------------------------------------------
+class CTEImpact : public CBaseTempEntity
+{
+public:
+ DECLARE_CLASS( CTEImpact, CBaseTempEntity );
+
+ DECLARE_SERVERCLASS();
+
+ CTEImpact( const char *name );
+ virtual ~CTEImpact();
+
+ void Precache( void );
+ void Test( const Vector& current_origin, const Vector& current_normal );
+
+public:
+
+ CNetworkVector( m_vecOrigin );
+ CNetworkVector( m_vecNormal ); //NOTENOTE: In a multi-play setup we'll probably want non-oriented effects for bandwidth
+ CNetworkVar( int, m_iType );
+};
+
+//-----------------------------------------------------------------------------
+// Purpose:
+// Input : *name -
+// Output :
+//-----------------------------------------------------------------------------
+CTEImpact::CTEImpact( const char *name ) : CBaseTempEntity( name )
+{
+ m_vecOrigin.Init();
+ m_vecNormal.Init();
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+//-----------------------------------------------------------------------------
+CTEImpact::~CTEImpact( void )
+{
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+//-----------------------------------------------------------------------------
+void CTEImpact::Precache( void )
+{
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+// Input : *current_origin -
+// *current_angles -
+//-----------------------------------------------------------------------------
+void CTEImpact::Test( const Vector& current_origin, const Vector& current_normal )
+{
+}
+
+
+//Server class implementation
+IMPLEMENT_SERVERCLASS_ST( CTEImpact, DT_TEImpact)
+ SendPropVector( SENDINFO( m_vecOrigin ), -1, SPROP_COORD ),
+ SendPropVector( SENDINFO( m_vecNormal ), -1, SPROP_COORD ),
+ SendPropInt( SENDINFO( m_iType ), 32, SPROP_UNSIGNED ),
+END_SEND_TABLE()
+
+// Singleton to fire TEImpact objects
+static CTEImpact g_TEImpact( "Impact" );
+
+//-----------------------------------------------------------------------------
+// Purpose:
+// Input : msg_dest -
+// delay -
+// *origin -
+// *recipient -
+//-----------------------------------------------------------------------------
+void TE_Impact( IRecipientFilter& filter, float delay )
+{
+ g_TEImpact.Create( filter, delay );
+} \ No newline at end of file