diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/shared/cstrike/weapon_hegrenade.cpp | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/shared/cstrike/weapon_hegrenade.cpp')
| -rw-r--r-- | game/shared/cstrike/weapon_hegrenade.cpp | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/game/shared/cstrike/weapon_hegrenade.cpp b/game/shared/cstrike/weapon_hegrenade.cpp new file mode 100644 index 0000000..e8303d0 --- /dev/null +++ b/game/shared/cstrike/weapon_hegrenade.cpp @@ -0,0 +1,67 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//=============================================================================// + +#include "cbase.h" +#include "weapon_csbase.h" +#include "gamerules.h" +#include "npcevent.h" +#include "engine/IEngineSound.h" +#include "weapon_hegrenade.h" + + +#ifdef CLIENT_DLL + +#else + + #include "cs_player.h" + #include "items.h" + #include "hegrenade_projectile.h" + +#endif + + +#define GRENADE_TIMER 3.0f //Seconds + + + +IMPLEMENT_NETWORKCLASS_ALIASED( HEGrenade, DT_HEGrenade ) + +BEGIN_NETWORK_TABLE(CHEGrenade, DT_HEGrenade) +END_NETWORK_TABLE() + +BEGIN_PREDICTION_DATA( CHEGrenade ) +END_PREDICTION_DATA() + +LINK_ENTITY_TO_CLASS( weapon_hegrenade, CHEGrenade ); +PRECACHE_WEAPON_REGISTER( weapon_hegrenade ); + + +#ifndef CLIENT_DLL + + BEGIN_DATADESC( CHEGrenade ) + END_DATADESC() + + void CHEGrenade::EmitGrenade( Vector vecSrc, QAngle vecAngles, Vector vecVel, AngularImpulse angImpulse, CBasePlayer *pPlayer ) + { + //============================================================================= + // HPE_BEGIN: + // [Forrest] Start a new bullet group so that damage dealt by the grenade will be counted as a separate hit from damage previously dealt. + //============================================================================= +#ifdef GAME_DLL + CCSPlayer *pCSPlayer = ToCSPlayer( pPlayer ); + if ( pCSPlayer ) + { + pCSPlayer->StartNewBulletGroup(); + } +#endif + //============================================================================= + // HPE_END + //============================================================================= + CHEGrenadeProjectile::Create( vecSrc, vecAngles, vecVel, angImpulse, pPlayer, GRENADE_TIMER ); + } + +#endif + |