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.

48 lines
1.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "weapon_dodbasegrenade.h"
  8. #ifdef CLIENT_DLL
  9. #define CWeaponHandGrenade C_WeaponHandGrenade
  10. #else
  11. #include "dod_handgrenade.h" //the thing that we throw
  12. #endif
  13. class CWeaponHandGrenade : public CWeaponDODBaseGrenade
  14. {
  15. public:
  16. DECLARE_CLASS( CWeaponHandGrenade, CWeaponDODBaseGrenade );
  17. DECLARE_NETWORKCLASS();
  18. DECLARE_PREDICTABLE();
  19. CWeaponHandGrenade() {}
  20. virtual DODWeaponID GetWeaponID( void ) const { return WEAPON_FRAG_US; }
  21. #ifndef CLIENT_DLL
  22. virtual void EmitGrenade( Vector vecSrc, QAngle vecAngles, Vector vecVel, AngularImpulse angImpulse, CBasePlayer *pPlayer, float flLifeTime = GRENADE_FUSE_LENGTH )
  23. {
  24. CDODHandGrenade::Create( vecSrc, vecAngles, vecVel, angImpulse, pPlayer, flLifeTime, GetWeaponID() );
  25. }
  26. #endif
  27. private:
  28. CWeaponHandGrenade( const CWeaponHandGrenade & );
  29. };
  30. IMPLEMENT_NETWORKCLASS_ALIASED( WeaponHandGrenade, DT_WeaponHandGrenade )
  31. BEGIN_NETWORK_TABLE(CWeaponHandGrenade, DT_WeaponHandGrenade)
  32. END_NETWORK_TABLE()
  33. BEGIN_PREDICTION_DATA( CWeaponHandGrenade )
  34. END_PREDICTION_DATA()
  35. LINK_ENTITY_TO_CLASS( weapon_frag_us, CWeaponHandGrenade );
  36. PRECACHE_WEAPON_REGISTER( weapon_frag_us );