summaryrefslogtreecommitdiff
path: root/game/shared/cstrike/weapon_hegrenade.cpp
blob: e8303d094668ff76596945f18c00c51667677420 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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