summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2002-01-28 21:51:14 +0000
committerTim Angus <tim@ngus.net>2002-01-28 21:51:14 +0000
commitc7f239a68ae042d023d075c6ac94e172205e69c5 (patch)
tree11f4e2e6924b1c5ddb4dc7daa244a35dd3a59e97
parentb19ba833615a4be31532f8cf79e397ec4006cdc1 (diff)
General corpse updates
-rw-r--r--src/cgame/cg_players.c50
-rw-r--r--src/game/g_client.c32
-rw-r--r--src/game/g_cmds.c3
-rw-r--r--src/game/g_combat.c5
4 files changed, 60 insertions, 30 deletions
diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c
index 9a95556c..326ae51e 100644
--- a/src/cgame/cg_players.c
+++ b/src/cgame/cg_players.c
@@ -1216,9 +1216,21 @@ static void CG_PlayerAngles( centity_t *cent, vec3_t legs[3], vec3_t torso[3], v
torsoAngles[YAW] = headAngles[YAW] + 0.25 * movementOffsets[ dir ];
// torso
- CG_SwingAngles( torsoAngles[YAW], 25, 90, cg_swingSpeed.value, &cent->pe.torso.yawAngle, &cent->pe.torso.yawing );
- CG_SwingAngles( legsAngles[YAW], 40, 90, cg_swingSpeed.value, &cent->pe.legs.yawAngle, &cent->pe.legs.yawing );
-
+ if( cent->currentState.eFlags & EF_DEAD )
+ {
+ CG_SwingAngles( torsoAngles[YAW], 0, 0, cg_swingSpeed.value,
+ &cent->pe.torso.yawAngle, &cent->pe.torso.yawing );
+ CG_SwingAngles( legsAngles[YAW], 0, 0, cg_swingSpeed.value,
+ &cent->pe.legs.yawAngle, &cent->pe.legs.yawing );
+ }
+ else
+ {
+ CG_SwingAngles( torsoAngles[YAW], 25, 90, cg_swingSpeed.value,
+ &cent->pe.torso.yawAngle, &cent->pe.torso.yawing );
+ CG_SwingAngles( legsAngles[YAW], 40, 90, cg_swingSpeed.value,
+ &cent->pe.legs.yawAngle, &cent->pe.legs.yawing );
+ }
+
torsoAngles[YAW] = cent->pe.torso.yawAngle;
legsAngles[YAW] = cent->pe.legs.yawAngle;
@@ -1951,9 +1963,9 @@ void CG_Player( centity_t *cent )
//
CG_AddPlayerWeapon( &torso, NULL, cent );
- if( ( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_ALIENS ) &&
+/* if( ( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_ALIENS ) &&
( ( cent->currentState.powerups & 0xFF ) == PTE_HUMANS ) )
- trap_R_AddAdditiveLightToScene( cent->lerpOrigin, 64, 0.1, 0.1, 0.4 );
+ trap_R_AddAdditiveLightToScene( cent->lerpOrigin, 64, 0.1, 0.1, 0.4 );*/
}
/*
@@ -1981,9 +1993,8 @@ void CG_Corpse( centity_t *cent )
// it is possible to see corpses from disconnected players that may
// not have valid clientinfo
- if ( !ci->infoValid ) {
+ if( !ci->infoValid )
return;
- }
memset( &legs, 0, sizeof(legs) );
memset( &torso, 0, sizeof(torso) );
@@ -1993,6 +2004,7 @@ void CG_Corpse( centity_t *cent )
BG_FindBBoxForClass( cent->currentState.clientNum, liveZ, NULL, NULL, deadZ, NULL );
origin[ 2 ] -= ( liveZ[ 2 ] - deadZ[ 2 ] );
+ VectorCopy( cent->currentState.angles, cent->lerpAngles );
// get the rotation information
CG_PlayerAngles( cent, legs.axis, torso.axis, head.axis );
@@ -2018,9 +2030,9 @@ void CG_Corpse( centity_t *cent )
// get the player model information
renderfx = 0;
- if ( cg_shadows.integer == 3 && shadow ) {
+ if( cg_shadows.integer == 3 && shadow )
renderfx |= RF_SHADOW_PLANE;
- }
+
renderfx |= RF_LIGHTING_ORIGIN; // use the same origin for all
//
@@ -2040,17 +2052,15 @@ void CG_Corpse( centity_t *cent )
trap_R_AddRefEntityToScene( &legs );
// if the model failed, allow the default nullmodel to be displayed
- if (!legs.hModel) {
+ if( !legs.hModel )
return;
- }
//
// add the torso
//
torso.hModel = ci->torsoModel;
- if (!torso.hModel) {
+ if( !torso.hModel )
return;
- }
torso.customSkin = ci->torsoSkin;
@@ -2068,9 +2078,9 @@ void CG_Corpse( centity_t *cent )
// add the head
//
head.hModel = ci->headModel;
- if (!head.hModel) {
+ if( !head.hModel )
return;
- }
+
head.customSkin = ci->headSkin;
VectorCopy( origin, head.lightingOrigin );
@@ -2082,6 +2092,16 @@ void CG_Corpse( centity_t *cent )
//CG_AddRefEntityWithPowerups( &head, cent->currentState.powerups, ci->team );
trap_R_AddRefEntityToScene( &head );
+
+ if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_ALIENS )
+ {
+ if( cent->currentState.powerups == cg.predictedPlayerState.clientNum ||
+ cent->currentState.powerups == 65535 ) //65535 = 16bit signed -1
+ {
+ //draw indicator
+ CG_PlayerFloatSprite( cent, cgs.media.medalImpressive );
+ }
+ }
}
diff --git a/src/game/g_client.c b/src/game/g_client.c
index ae435f88..4c000809 100644
--- a/src/game/g_client.c
+++ b/src/game/g_client.c
@@ -572,7 +572,11 @@ void BodySink( gentity_t *ent )
{
//arbituary number > 100 and < time since nextthink was set
if( level.time - ent->nextthink > 1000 )
+ {
+ //sinking bodies can't be infested
+ ent->killedBy = ent->s.powerups = MAX_CLIENTS;
ent->timestamp = level.time;
+ }
if( level.time - ent->timestamp > 6500 )
{
@@ -666,6 +670,16 @@ void SpawnCorpse( gentity_t *ent )
body = G_Spawn( );
+ VectorCopy( ent->s.apos.trBase, body->s.angles );
+ body->s.eFlags = EF_DEAD;
+ body->s.eType = ET_CORPSE;
+ body->s.number = body - g_entities;
+ body->timestamp = level.time;
+ body->s.event = 0;
+ body->r.contents = CONTENTS_CORPSE;
+ body->clipmask = CONTENTS_SOLID | CONTENTS_PLAYERCLIP;
+ body->s.clientNum = ent->client->ps.stats[ STAT_PCLASS ];
+
if( ent->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS )
{
gentity_t *buildable = &g_entities[ ent->client->lasthurt_client ];
@@ -685,31 +699,23 @@ void SpawnCorpse( gentity_t *ent )
else // *shrugs* probably killed by some map entity - freebie
body->killedBy = -1;
+ body->s.powerups = body->killedBy;
+
//the body becomes free in a minute
body->think = BodyFree;
+ body->use = useBody;
body->nextthink = level.time + 60000;
}
else
{
body->classname = "alienCorpse";
+ body->s.powerups = MAX_CLIENTS;
body->think = BodySink;
body->nextthink = level.time + 60000;
}
- body->s = ent->s;
- body->r.s = body->s;
- body->s.eFlags = EF_DEAD;
- body->s.eType = ET_CORPSE;
- body->s.number = body - g_entities;
- body->timestamp = level.time;
- body->s.event = 0;
- body->r.contents = CONTENTS_CORPSE;
- body->clipmask = MASK_SHOT;
- body->s.clientNum = ent->client->ps.stats[ STAT_PCLASS ];
-
- body->use = useBody;
-
+ body->s.legsAnim = ent->s.legsAnim;
switch( body->s.legsAnim & ~ANIM_TOGGLEBIT )
{
case BOTH_DEATH1:
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 5e59827c..92ed0311 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -1624,6 +1624,9 @@ void Cmd_Class_f( gentity_t *ent )
G_SetOrigin( ent, infestOrigin );
VectorCopy( infestOrigin, ent->client->ps.origin );
SetClientViewAngle( ent, infestAngles );
+
+ //so no one can claim this body as of now
+ victim->killedBy = victim->s.powerups = MAX_CLIENTS;
}
else
{
diff --git a/src/game/g_combat.c b/src/game/g_combat.c
index 9c2ef786..8ec9dd93 100644
--- a/src/game/g_combat.c
+++ b/src/game/g_combat.c
@@ -407,8 +407,9 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
self->r.contents = CONTENTS_BODY;
//self->r.contents = CONTENTS_CORPSE;
- self->s.angles[ 0 ] = 0;
- self->s.angles[ 2 ] = 0;
+ self->s.angles[ PITCH ] = 0;
+ self->s.angles[ ROLL ] = 0;
+ self->s.angles[ YAW ] = self->s.apos.trBase[ YAW ];
LookAtKiller( self, inflictor, attacker );
VectorCopy( self->s.angles, self->client->ps.viewangles );