summaryrefslogtreecommitdiff
path: root/src/game/g_combat.c
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2015-06-29 00:52:09 +0200
committerPaweł Redman <pawel.redman@gmail.com>2015-06-29 16:40:28 +0200
commit0918eb3bcdefd0d6ee4bd573b761454c99f032f6 (patch)
treedd1bd0bfe5348ad3b4860f11b7d3dcbb6db9ca3c /src/game/g_combat.c
parent93d2e4414ee25e417ee0d2ca0248448002ea4d5b (diff)
Initial implementation of new grenades.
Diffstat (limited to 'src/game/g_combat.c')
-rw-r--r--src/game/g_combat.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/game/g_combat.c b/src/game/g_combat.c
index bfe0de9..397bde0 100644
--- a/src/game/g_combat.c
+++ b/src/game/g_combat.c
@@ -432,6 +432,21 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
if( level.intermissiontime )
return;
+ if( self->client->ps.weapon == WP_GRENADE &&
+ self->client->ps.stats[ STAT_MISC ] > 0 )
+ {
+ int fuse_left;
+
+ fuse_left = GRENADE_FUSE_TIME - self->client->ps.stats[ STAT_MISC ];
+
+ if( fuse_left < 0 )
+ {
+ fuse_left = 0;
+ }
+
+ launch_grenade( self, self->s.origin, vec3_origin, fuse_left );
+ }
+
self->client->ps.pm_type = PM_DEAD;
self->suicideTime = 0;