summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/g_client.c32
-rw-r--r--src/game/g_cmds.c3
-rw-r--r--src/game/g_combat.c5
3 files changed, 25 insertions, 15 deletions
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 );