diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2015-04-03 22:27:39 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2015-04-03 22:27:39 +0200 |
commit | f3008f9819d57b671a424a0097f50c93926af74e (patch) | |
tree | b7e3ee86c56f9eb6cf0e5fa4e2182e6916b6c740 /src | |
parent | 1e7d1146407a5d6dde817ada79ce428b0cb0f481 (diff) |
Fix radius damage missing targets randomly.
Diffstat (limited to 'src')
-rw-r--r-- | src/game/g_combat.c | 41 |
1 files changed, 12 insertions, 29 deletions
diff --git a/src/game/g_combat.c b/src/game/g_combat.c index c095d1c..50bfea3 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -1451,46 +1451,29 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, attacker->client->bufferedBlobCount < MAX_BUFFERED_BLOBS ) { g_damageBlob_t *blob; - int flags = 0; + + 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 ); } if( targ->health <= 0 ) |