summaryrefslogtreecommitdiff
path: root/src/cgame/cg_weapons.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgame/cg_weapons.c')
-rw-r--r--src/cgame/cg_weapons.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c
index 74a1ef6a..a53336f9 100644
--- a/src/cgame/cg_weapons.c
+++ b/src/cgame/cg_weapons.c
@@ -601,6 +601,11 @@ void CG_RegisterWeapon( int weaponNum ) {
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav", qfalse );
break;
+ case WP_POUNCE:
+ MAKERGB( weaponInfo->flashDlightColor, 0, 0, 0 );
+ weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav", qfalse );
+ break;
+
case WP_DBUILD:
case WP_HBUILD:
case WP_SCANNER:
@@ -941,19 +946,35 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent
if ( ps )
{
if ( cg.predictedPlayerState.weapon == WP_RAILGUN
- && cg.predictedPlayerState.weaponstate == WEAPON_FIRING ) {
+ && cg.predictedPlayerState.weaponstate == WEAPON_FIRING )
+ {
float f;
f = (float)cg.predictedPlayerState.weaponTime / 1500;
gun.shaderRGBA[1] = 0;
gun.shaderRGBA[0] =
gun.shaderRGBA[2] = 255 * ( 1.0 - f );
- } else {
+ }
+ else
+ {
gun.shaderRGBA[0] = 255;
gun.shaderRGBA[1] = 255;
gun.shaderRGBA[2] = 255;
gun.shaderRGBA[3] = 255;
}
+
+ //set weapon[1/2]Time when respective buttons change state
+ if( cg.weapon1Firing != ( cg.predictedPlayerState.eFlags & EF_FIRING ) )
+ {
+ cg.weapon1Time = cg.time;
+ cg.weapon1Firing = ( cg.predictedPlayerState.eFlags & EF_FIRING );
+ }
+
+ if( cg.weapon2Firing != ( cg.predictedPlayerState.eFlags & EF_FIRING2 ) )
+ {
+ cg.weapon2Time = cg.time;
+ cg.weapon2Firing = ( cg.predictedPlayerState.eFlags & EF_FIRING2 );
+ }
}
gun.hModel = weapon->weaponModel;