Talk:Env tracer
Jump to navigation
Jump to search
What is the actual use of this entity? Pinsplash (talk) 15:39, 16 July 2018 (UTC)
- No idea, I'll just put the entire code for the entity and you make the conclusion.--Ficool2 (talk) 15:45, 16 July 2018 (UTC)
// ENV_TRACER // Fakes a tracer class CEnvTracer : public CPointEntity { public: DECLARE_CLASS( CEnvTracer, CPointEntity ); void Spawn( void ); void TracerThink( void ); void Activate( void ); DECLARE_DATADESC(); Vector m_vecEnd; float m_flDelay; }; LINK_ENTITY_TO_CLASS( env_tracer, CEnvTracer ); BEGIN_DATADESC( CEnvTracer ) DEFINE_KEYFIELD( m_flDelay, FIELD_FLOAT, "delay" ), DEFINE_FIELD( m_vecEnd, FIELD_POSITION_VECTOR ), // Function Pointers DEFINE_FUNCTION( TracerThink ), END_DATADESC() //----------------------------------------------------------------------------- // Purpose: Called after keyvalues are parsed. //----------------------------------------------------------------------------- void CEnvTracer::Spawn( void ) { SetSolid( SOLID_NONE ); SetMoveType( MOVETYPE_NONE ); if (!m_flDelay) m_flDelay = 1; } //----------------------------------------------------------------------------- // Purpose: Called after all the entities have been loaded. //----------------------------------------------------------------------------- void CEnvTracer::Activate( void ) { BaseClass::Activate(); CBaseEntity *pEnd = gEntList.FindEntityByName( NULL, m_target ); if (pEnd != NULL) { m_vecEnd = pEnd->GetLocalOrigin(); SetThink( &CEnvTracer::TracerThink ); SetNextThink( gpGlobals->curtime + m_flDelay ); } else { Msg( "env_tracer: unknown entity \"%s\"\n", STRING(m_target) ); } } // Think void CEnvTracer::TracerThink( void ) { UTIL_Tracer( GetAbsOrigin(), m_vecEnd ); SetNextThink( gpGlobals->curtime + m_flDelay ); }