From ef371ec4b5069dfda294e660053c7c929b986f1c Mon Sep 17 00:00:00 2001 From: /dev/humancontroller Date: Sun, 13 Jul 2014 16:30:16 +0200 Subject: always spawn corpses where the model coincides with the ending state of the death animation --- src/game/g_client.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src/game') 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 ); } -- cgit