diff options
author | Tim Angus <tim@ngus.net> | 2001-02-01 02:23:21 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2001-02-01 02:23:21 +0000 |
commit | 4506d6a566309f62eb3db1bcf0d8b9a4fc4eaa1d (patch) | |
tree | 1ee5389805f0422e686d904e077710e8e5b0e3d5 /src/game | |
parent | 8de2b273db9da3a4a2db285614141e4e31849846 (diff) |
Body spawning improved. The usual bug fixes
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_pmove.c | 10 | ||||
-rw-r--r-- | src/game/g_active.c | 8 | ||||
-rw-r--r-- | src/game/g_client.c | 29 | ||||
-rw-r--r-- | src/game/g_combat.c | 7 | ||||
-rw-r--r-- | src/game/g_main.c | 3 | ||||
-rw-r--r-- | src/game/g_mover.c | 4 |
6 files changed, 28 insertions, 33 deletions
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index f36cd3e3..4c8fe6dc 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -1700,7 +1700,11 @@ static void PM_GroundTrace( void ) { point[1] = pm->ps->origin[1]; point[2] = pm->ps->origin[2] - 0.25; - pm->trace (&trace, pm->ps->origin, pm->mins, pm->maxs, point, pm->ps->clientNum, pm->tracemask); + //FIXME: hack until i find out where CONTENTS_BODY is getting unset for uhm.. bodies. + if( pm->ps->pm_type == PM_DEAD ) + pm->trace (&trace, pm->ps->origin, pm->mins, pm->maxs, point, pm->ps->clientNum, MASK_PLAYERSOLID ); + else + pm->trace (&trace, pm->ps->origin, pm->mins, pm->maxs, point, pm->ps->clientNum, pm->tracemask); pml.groundTrace = trace; // do something corrective if the trace starts in a solid... @@ -2652,9 +2656,9 @@ void PmoveSingle (pmove_t *pmove) pm->watertype = 0; pm->waterlevel = 0; - if ( pm->ps->stats[STAT_HEALTH] <= 0 ) { + /*if ( pm->ps->stats[STAT_HEALTH] <= 0 ) { pm->tracemask &= ~CONTENTS_BODY; // corpses can fly through bodies - } + }*/ // make sure walking button is clear if they are running, to avoid // proxy no-footsteps cheats diff --git a/src/game/g_active.c b/src/game/g_active.c index 3c48cbc7..c9e024c8 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -778,7 +778,9 @@ void ClientThink_real( gentity_t *ent ) { light->parent = ent; client->torch = light; } - else if( client->torch != NULL && !BG_activated( UP_TORCH, client->ps.stats ) ) + + if( ( client->torch != NULL && !BG_activated( UP_TORCH, client->ps.stats ) ) || + ( client->torch != NULL && BG_activated( UP_TORCH, client->ps.stats ) && pm.ps->pm_type == PM_DEAD ) ) { G_FreeEntity( client->torch ); trap_LinkEntity( client->torch ); @@ -811,7 +813,7 @@ void ClientThink_real( gentity_t *ent ) { pm.ps = &client->ps; pm.cmd = *ucmd; if ( pm.ps->pm_type == PM_DEAD ) { - pm.tracemask = MASK_PLAYERSOLID & ~CONTENTS_BODY; + pm.tracemask = MASK_PLAYERSOLID; // & ~CONTENTS_BODY; } else if ( ent->r.svFlags & SVF_BOT ) { pm.tracemask = MASK_PLAYERSOLID | CONTENTS_BOTCLIP; @@ -910,7 +912,7 @@ void ClientThink_real( gentity_t *ent ) { if ( level.time > client->respawnTime ) { // forcerespawn is to prevent users from waiting out powerups if ( g_forcerespawn.integer > 0 && - ( level.time - client->respawnTime ) > g_forcerespawn.integer * 1000 ) { + ( level.time - client->respawnTime ) > 0 ) { //g_forcerespawn.integer * 1000 ) { respawn( ent ); return; } diff --git a/src/game/g_client.c b/src/game/g_client.c index 788aa1e1..90fabc38 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -558,15 +558,10 @@ just like the existing corpse to leave behind. */ void CopyToBodyQue( gentity_t *ent ) { gentity_t *body; - int contents; + int contents; + vec3_t origin; - //TA: not really the place for this.. but hey.. - if( ent->client->torch != NULL && BG_activated( UP_TORCH, ent->client->ps.stats ) ) - { - G_FreeEntity( ent->client->torch ); - trap_UnlinkEntity( ent->client->torch ); - ent->client->torch = NULL; - } + VectorCopy( ent->r.currentOrigin, origin ); trap_UnlinkEntity (ent); @@ -584,7 +579,6 @@ void CopyToBodyQue( gentity_t *ent ) { body->s.eType = ET_CORPSE; body->s.number = body - g_entities; body->timestamp = level.time; - body->physicsObject = qtrue; body->s.event = 0; body->r.contents = CONTENTS_BODY; body->clipmask = MASK_PLAYERSOLID; @@ -626,21 +620,12 @@ void CopyToBodyQue( gentity_t *ent ) { //FIXME: change body dimensions VectorSet( body->r.mins, -15, -15, -15 ); VectorSet( body->r.maxs, 15, 15, 15 ); - VectorSet( body->r.absmin, -15, -15, -15 ); - VectorSet( body->r.absmax, 15, 15, 15 ); - if ( body->s.groundEntityNum == ENTITYNUM_NONE ) - { - body->s.pos.trType = TR_GRAVITY; - body->s.pos.trTime = level.time; - VectorCopy( ent->client->ps.velocity, body->s.pos.trDelta ); - } - else - { - body->s.pos.trType = TR_STATIONARY; - } - + 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 ); diff --git a/src/game/g_combat.c b/src/game/g_combat.c index a14adeb7..5394314f 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -485,7 +485,8 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int self->s.weapon = WP_NONE; self->s.powerups = 0; - self->r.contents = CONTENTS_CORPSE; + self->r.contents = CONTENTS_BODY; + //self->r.contents = CONTENTS_CORPSE; self->s.angles[0] = 0; self->s.angles[2] = 0; @@ -505,10 +506,10 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int memset( self->client->ps.powerups, 0, sizeof(self->client->ps.powerups) ); // never gib in a nodrop - if ( self->health <= GIB_HEALTH && !(contents & CONTENTS_NODROP) && g_blood.integer ) { + /*if ( self->health <= GIB_HEALTH && !(contents & CONTENTS_NODROP) && g_blood.integer ) { // gib death GibEntity( self, killer ); - } else { + } else*/ { // normal death static int i; diff --git a/src/game/g_main.c b/src/game/g_main.c index 7019451a..d5b6479f 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -1823,7 +1823,8 @@ start = trap_Milliseconds(); continue; } - if ( ( ent->s.eType == ET_ITEM || ent->s.eType == ET_BUILDABLE ) || ent->physicsObject ) { + if ( ent->s.eType == ET_ITEM || ent->s.eType == ET_BUILDABLE || + ent->s.eType == ET_CORPSE || ent->physicsObject ) { G_RunItem( ent ); continue; } diff --git a/src/game/g_mover.c b/src/game/g_mover.c index 47496e9d..b4cd4b45 100644 --- a/src/game/g_mover.c +++ b/src/game/g_mover.c @@ -234,7 +234,9 @@ qboolean G_MoverPush( gentity_t *pusher, vec3_t move, vec3_t amove, gentity_t ** check = &g_entities[ entityList[ e ] ]; // only push items and players - if ( check->s.eType != ET_ITEM && check->s.eType != ET_BUILDABLE && check->s.eType != ET_PLAYER && !check->physicsObject ) { + if ( check->s.eType != ET_ITEM && check->s.eType != ET_BUILDABLE && + check->s.eType != ET_CORPSE && check->s.eType != ET_PLAYER && + !check->physicsObject ) { continue; } |