summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author/dev/humancontroller <devhc@example.com>2014-07-13 16:30:16 +0200
committer/dev/humancontroller <devhc@example.com>2017-03-09 13:51:09 +0100
commitef371ec4b5069dfda294e660053c7c929b986f1c (patch)
tree0032b17d4f093d89ccf37f7bcdfee19dfe525aa8 /src
parent61000eb1346fd78b079f7aa89161bc58b387bcdc (diff)
always spawn corpses where the model coincides with the ending state of the death animation
Diffstat (limited to 'src')
-rw-r--r--src/game/g_client.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/game/g_client.c b/src/game/g_client.c
index b4d4e1b3..d9f7e541 100644
--- a/src/game/g_client.c
+++ b/src/game/g_client.c
@@ -448,9 +448,7 @@ static void SpawnCorpse( gentity_t *ent )
{
gentity_t *body;
int contents;
- vec3_t origin, dest;
- trace_t tr;
- float vDiff;
+ vec3_t origin, mins;
VectorCopy( ent->r.currentOrigin, origin );
@@ -531,21 +529,16 @@ static void SpawnCorpse( gentity_t *ent )
ent->health = 0;
//change body dimensions
- BG_ClassBoundingBox( ent->client->ps.stats[ STAT_CLASS ], NULL, NULL, NULL, body->r.mins, body->r.maxs );
- vDiff = body->r.mins[ 2 ] - ent->r.mins[ 2 ];
+ BG_ClassBoundingBox( ent->client->ps.stats[ STAT_CLASS ], mins, NULL, NULL, body->r.mins, body->r.maxs );
//drop down to match the *model* origins of ent and body
- VectorSet( dest, origin[ 0 ], origin[ 1 ], origin[ 2 ] - vDiff );
- trap_Trace( &tr, origin, body->r.mins, body->r.maxs, dest, body->s.number, body->clipmask );
- VectorCopy( tr.endpos, origin );
+ origin[2] += mins[ 2 ] - body->r.mins[ 2 ];
G_SetOrigin( body, origin );
- VectorCopy( origin, body->s.origin );
body->s.pos.trType = TR_GRAVITY;
body->s.pos.trTime = level.time;
VectorCopy( ent->client->ps.velocity, body->s.pos.trDelta );
- VectorCopy ( body->s.pos.trBase, body->r.currentOrigin );
trap_LinkEntity( body );
}