diff options
author | Petr Pudlak <petr.mvd@gmail.com> | 2014-08-19 22:24:50 +0200 |
---|---|---|
committer | Petr Pudlak <petr.mvd@gmail.com> | 2014-08-19 22:24:50 +0200 |
commit | 943539a1a7741d395667f2830b31cfdfea5e0816 (patch) | |
tree | e76f922ef468a6230cb97e26f5a72d135eca0e67 /src/game/g_combat.c | |
parent | a7ca0aa8c8a66adce30b8ac21d4849b91e4fc75b (diff) |
The head-shot mod: headshots on humans splash blood around
.. using the particle system. Blood drops splat on impact.
Diffstat (limited to 'src/game/g_combat.c')
-rw-r--r-- | src/game/g_combat.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/game/g_combat.c b/src/game/g_combat.c index c79594d..073c00c 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -687,8 +687,12 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int } // use own entityid if killed by non-client to prevent uint8_t overflow - G_AddEvent( self, EV_DEATH1 + i, - ( killer < MAX_CLIENTS ) ? killer : self - g_entities ); + { + int param = ( killer < MAX_CLIENTS ) ? killer : self - g_entities; + if( self->client->damage_headshot ) + param |= EVENT_HEADSHOT_BIT; + G_AddEvent( self, EV_DEATH1 + i, param ); + } // globally cycle through the different death animations i = ( i + 1 ) % 3; @@ -1069,6 +1073,10 @@ static float G_CalcDamageModifier( vec3_t point, gentity_t *targ, gentity_t *att g_numDamageRegions[ class ], hitRotation, hitRatio ); + // For headshots done by an enemy, make a client event + if( ( modifier >= 1.2f ) && !OnSameTeam( targ, attacker ) ) + targ->client->damage_headshot ++; + for( i = UP_NONE + 1; i < UP_NUM_UPGRADES; i++ ) { if( BG_InventoryContainsUpgrade( i, targ->client->ps.stats ) ) |