Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. // $NoKeywords: $
  8. //=============================================================================//
  9. #include "cbase.h"
  10. #include "entitylist.h"
  11. // memdbgon must be the last include file in a .cpp file!!!
  12. #include "tier0/memdbgon.h"
  13. //=========================================================
  14. // Multiplayer intermission spots.
  15. //=========================================================
  16. class CInfoIntermission:public CPointEntity
  17. {
  18. public:
  19. DECLARE_CLASS( CInfoIntermission, CPointEntity );
  20. void Spawn( void );
  21. void Think( void );
  22. };
  23. void CInfoIntermission::Spawn( void )
  24. {
  25. SetSolid( SOLID_NONE );
  26. AddEffects( EF_NODRAW );
  27. SetLocalAngles( vec3_angle );
  28. SetNextThink( gpGlobals->curtime + 2 );// let targets spawn !
  29. }
  30. void CInfoIntermission::Think ( void )
  31. {
  32. CBaseEntity *pTarget;
  33. // find my target
  34. pTarget = gEntList.FindEntityByName( NULL, m_target );
  35. if ( pTarget )
  36. {
  37. Vector dir = pTarget->GetLocalOrigin() - GetLocalOrigin();
  38. VectorNormalize( dir );
  39. QAngle angles;
  40. VectorAngles( dir, angles );
  41. SetLocalAngles( angles );
  42. }
  43. }
  44. LINK_ENTITY_TO_CLASS( info_intermission, CInfoIntermission );