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.

52 lines
1.5 KiB

  1. //====== Copyright � 1996-2005, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #include "cbase.h"
  7. #include "weapon_csbase.h"
  8. #include "gamerules.h"
  9. #include "npcevent.h"
  10. #include "engine/IEngineSound.h"
  11. #include "weapon_sensorgrenade.h"
  12. #ifdef CLIENT_DLL
  13. #else
  14. #include "cs_player.h"
  15. #include "items.h"
  16. #include "sensorgrenade_projectile.h"
  17. #endif
  18. // NOTE: This has to be the last file included!
  19. #include "tier0/memdbgon.h"
  20. IMPLEMENT_NETWORKCLASS_ALIASED( SensorGrenade, DT_SensorGrenade )
  21. BEGIN_NETWORK_TABLE(CSensorGrenade, DT_SensorGrenade)
  22. END_NETWORK_TABLE()
  23. BEGIN_PREDICTION_DATA( CSensorGrenade )
  24. END_PREDICTION_DATA()
  25. LINK_ENTITY_TO_CLASS_ALIASED( weapon_tagrenade, SensorGrenade );
  26. PRECACHE_REGISTER( weapon_tagrenade );
  27. #if !defined( CLIENT_DLL )
  28. BEGIN_DATADESC( CSensorGrenade )
  29. END_DATADESC()
  30. void CSensorGrenade::EmitGrenade( Vector vecSrc, QAngle vecAngles, Vector vecVel, AngularImpulse angImpulse, CBasePlayer *pPlayer, const CCSWeaponInfo& weaponInfo )
  31. {
  32. CSensorGrenadeProjectile::Create( vecSrc, vecAngles, vecVel, angImpulse, pPlayer, weaponInfo );
  33. }
  34. void CSensorGrenade::ShotDetonate( CBasePlayer *pPlayer, const CCSWeaponInfo& weaponInfo )
  35. {
  36. CSensorGrenadeProjectile* pGrenade = CSensorGrenadeProjectile::Create( this->GetAbsOrigin(), this->GetAbsAngles(), Vector(0,0,0), AngularImpulse(0,0,0), pPlayer, weaponInfo );
  37. if ( pGrenade )
  38. pGrenade->DetonateOnNextThink();
  39. }
  40. #endif // !CLIENT_DLL