summaryrefslogtreecommitdiff
path: root/src/game/g_physics.c
diff options
context:
space:
mode:
author/dev/humancontroller <devhc@example.com>2017-04-15 16:55:14 +0200
committer/dev/humancontroller <devhc@example.com>2017-04-15 16:55:14 +0200
commit7bfcf1fae886456c17e7e2fe9d47530ad1fd8162 (patch)
treef4aa7e2a417e90b10f741d0a11c6e3ce35480875 /src/game/g_physics.c
parentb0c9d60a370a1ae651e2850c3b07d6ffa1da69ce (diff)
do not treat a clipmask of 0 as MASK_DEADSOLID in some cases
remove the clipmask == 0 special cases from G_TestEntityPosition() and G_Physics(). when spawning corpses, set their clipmask to MASK_DEADSOLID instead of 0.
Diffstat (limited to 'src/game/g_physics.c')
-rw-r--r--src/game/g_physics.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/game/g_physics.c b/src/game/g_physics.c
index 58c6487..a104685 100644
--- a/src/game/g_physics.c
+++ b/src/game/g_physics.c
@@ -87,7 +87,6 @@ void G_Physics( gentity_t *ent, int msec )
vec3_t origin;
trace_t tr;
int contents;
- int mask;
// if groundentity has been set to -1, it may have been pushed off an edge
if( ent->s.groundEntityNum == -1 )
@@ -107,12 +106,6 @@ void G_Physics( gentity_t *ent, int msec )
}
}
- // trace a line from the previous position to the current position
- if( ent->clipmask )
- mask = ent->clipmask;
- else
- mask = MASK_PLAYERSOLID & ~CONTENTS_BODY;//MASK_SOLID;
-
if( ent->s.pos.trType == TR_STATIONARY )
{
// check think function
@@ -125,7 +118,7 @@ void G_Physics( gentity_t *ent, int msec )
VectorMA( origin, -2.0f, ent->s.origin2, origin );
- trap_Trace( &tr, ent->r.currentOrigin, ent->r.mins, ent->r.maxs, origin, ent->s.number, mask );
+ trap_Trace( &tr, ent->r.currentOrigin, ent->r.mins, ent->r.maxs, origin, ent->s.number, ent->clipmask );
if( tr.fraction == 1.0f )
ent->s.groundEntityNum = -1;
@@ -136,10 +129,12 @@ void G_Physics( gentity_t *ent, int msec )
return;
}
+ // trace a line from the previous position to the current position
+
// get current position
BG_EvaluateTrajectory( &ent->s.pos, level.time, origin );
- trap_Trace( &tr, ent->r.currentOrigin, ent->r.mins, ent->r.maxs, origin, ent->s.number, mask );
+ trap_Trace( &tr, ent->r.currentOrigin, ent->r.mins, ent->r.maxs, origin, ent->s.number, ent->clipmask );
VectorCopy( tr.endpos, ent->r.currentOrigin );