diff options
author | Mikko Tiusanen <ams@daug.net> | 2014-08-20 20:32:12 +0300 |
---|---|---|
committer | Mikko Tiusanen <ams@daug.net> | 2014-08-20 20:32:12 +0300 |
commit | 613030b05c409cef42b0e98d5180a41f8f67c661 (patch) | |
tree | 480cdbf625d7dcce1bb5477ab1dca6c9d8102106 /src/game/g_combat.c | |
parent | 7ad16ee1fea76bab54d97a78c1063b7c2c2adef6 (diff) | |
parent | 0a382e146ac52e111c90ad1e093ade77b710d993 (diff) |
Merge branch 'master' of https://github.com/mtiusane/new-edge
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 ) ) |