Counter Strike : Global Offensive Source Code
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.

44 lines
944 B

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #include "cbase.h"
  9. #include "movie_explosion.h"
  10. // memdbgon must be the last include file in a .cpp file!!!
  11. #include "tier0/memdbgon.h"
  12. #define MOVIEEXPLOSION_ENTITYNAME "env_movieexplosion"
  13. IMPLEMENT_SERVERCLASS_ST(MovieExplosion, DT_MovieExplosion)
  14. END_SEND_TABLE()
  15. LINK_ENTITY_TO_CLASS(env_movieexplosion, MovieExplosion);
  16. MovieExplosion* MovieExplosion::CreateMovieExplosion(const Vector &pos)
  17. {
  18. CBaseEntity *pEnt = CreateEntityByName(MOVIEEXPLOSION_ENTITYNAME);
  19. if(pEnt)
  20. {
  21. MovieExplosion *pEffect = dynamic_cast<MovieExplosion*>(pEnt);
  22. if(pEffect && pEffect->edict())
  23. {
  24. pEffect->SetLocalOrigin( pos );
  25. pEffect->Activate();
  26. return pEffect;
  27. }
  28. else
  29. {
  30. UTIL_Remove(pEnt);
  31. }
  32. }
  33. return NULL;
  34. }