diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2015-04-04 12:47:05 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2015-04-04 12:47:05 +0200 |
commit | e71cf2b9d657c112eb3674969a3185957f816d04 (patch) | |
tree | cf06d8de6e721722b87e562599e61c25f2570fcc /src/game | |
parent | 72f038ae632b0f9af485129747f5fca45898b52e (diff) | |
parent | 752d1bbed1f59eb45b3c89cbddc1430d817b1102 (diff) |
Merge branch 'damage-feedback'
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/g_combat.c | 47 |
1 files changed, 15 insertions, 32 deletions
diff --git a/src/game/g_combat.c b/src/game/g_combat.c index 1a54981..0c6086d 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -1447,52 +1447,35 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, G_CombatStats_HitMOD( attacker, targ, mod, take ); - if( attacker && attacker->client && take && attacker != targ ) + if( attacker && attacker->client && take && attacker != targ && + attacker->client->bufferedBlobCount < MAX_BUFFERED_BLOBS ) { g_damageBlob_t *blob; - int flags = 0; - if( attacker->client->bufferedBlobCount == MAX_BUFFERED_BLOBS ) - return; + blob = attacker->client->blobBuffer + + ( attacker->client->bufferedBlobCount++ ); + + blob->flags = 0; + blob->value = take; if( OnSameTeam( attacker, targ ) || ( targ->s.eType == ET_BUILDABLE && attacker->client->pers.teamSelection == targ->buildableTeam ) ) - flags |= DAMAGE_BLOB_FRIENDLY; + blob->flags |= DAMAGE_BLOB_FRIENDLY; if( targ->s.eType == ET_BUILDABLE ) - flags |= DAMAGE_BLOB_BUILDABLE; + blob->flags |= DAMAGE_BLOB_BUILDABLE; if( dflags & DAMAGE_RADIUS ) { - vec3_t mins = {0}, maxs = {0}; - - flags |= DAMAGE_BLOB_SPLASH; - - switch( targ->s.eType ) - { - case ET_BUILDABLE: - BG_BuildableBoundingBox( targ->s.modelindex, mins, maxs ); - break; - - case ET_PLAYER: - BG_ClassBoundingBox( targ->client->ps.stats[ STAT_CLASS ], mins, maxs, NULL, NULL, NULL ); - break; - } - - VectorAdd( mins, maxs, point ); - VectorScale( point, 0.5f, point ); - VectorAdd( point, targ->s.origin, point ); + blob->flags |= DAMAGE_BLOB_SPLASH; + VectorAdd( targ->r.absmin, targ->r.absmax, blob->origin ); + VectorScale( blob->origin, 0.5f, blob->origin ); } else if( inflictor->s.eType == ET_MISSILE ) - VectorCopy( inflictor->r.currentOrigin, point ); - - blob = attacker->client->blobBuffer + - ( attacker->client->bufferedBlobCount++ ); - - VectorCopy( point, blob->origin ); - blob->value = take; - blob->flags = flags; + VectorCopy( inflictor->r.currentOrigin, blob->origin ); + else + VectorCopy( point, blob->origin ); } if( targ->health <= 0 ) |