better SUPERCONTENTS masks for a few TraceBox and PointContents calls
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 14 Apr 2006 03:45:43 +0000 (03:45 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 14 Apr 2006 03:45:43 +0000 (03:45 +0000)
slight cleanups

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6274 d7cf8633-e32d-0410-b094-e92efae38249

cl_collision.c
collision.c
model_brush.c
sv_move.c

index 3ce2741..76f4126 100644 (file)
@@ -137,7 +137,7 @@ trace_t CL_TraceBox(const vec3_t start, const vec3_t mins, const vec3_t maxs, co
 
                                Matrix4x4_Transform(&ent->inversematrix, start, starttransformed);
                                Matrix4x4_Transform(&ent->inversematrix, end, endtransformed);
-                               Collision_ClipTrace_Box(&trace, playermins, playermaxs, starttransformed, mins, maxs, endtransformed, hitsupercontentsmask, SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY, 0, NULL);
+                               Collision_ClipTrace_Box(&trace, playermins, playermaxs, starttransformed, mins, maxs, endtransformed, hitsupercontentsmask, SUPERCONTENTS_BODY, 0, NULL);
 
                                // LordHavoc: take the 'best' answers from the new trace and combine with existing data
                                if (trace.allsolid)
@@ -197,7 +197,7 @@ float CL_SelectTraceLine(const vec3_t start, const vec3_t end, vec3_t impact, ve
        if (hitent)
                *hitent = 0;
        if (cl.worldmodel && cl.worldmodel->TraceBox)
-               cl.worldmodel->TraceBox(cl.worldmodel, 0, &trace, start, vec3_origin, vec3_origin, end, SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY);
+               cl.worldmodel->TraceBox(cl.worldmodel, 0, &trace, start, vec3_origin, vec3_origin, end, SUPERCONTENTS_SOLID);
 
        if (normal)
                VectorCopy(trace.plane.normal, normal);
@@ -245,7 +245,7 @@ float CL_SelectTraceLine(const vec3_t start, const vec3_t end, vec3_t impact, ve
                Matrix4x4_Transform(&ent->inversematrix, end, endtransformed);
 
                //if (ent->model && ent->model->TraceBox)
-                       ent->model->TraceBox(ent->model, ent->frameblend[0].frame, &trace, starttransformed, vec3_origin, vec3_origin, endtransformed, SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY);
+                       ent->model->TraceBox(ent->model, ent->frameblend[0].frame, &trace, starttransformed, vec3_origin, vec3_origin, endtransformed, SUPERCONTENTS_SOLID);
 
                if (maxrealfrac > trace.realfraction)
                {
index 25dc46a..fb7da1b 100644 (file)
@@ -990,12 +990,10 @@ void Collision_InitBrushForBox(void)
        int i;
        for (i = 0;i < MAX_BRUSHFORBOX;i++)
        {
-               brushforbox_brush[i].supercontents = SUPERCONTENTS_SOLID;
                brushforbox_brush[i].numpoints = 8;
                brushforbox_brush[i].numplanes = 6;
                brushforbox_brush[i].points = brushforbox_point + i * 8;
                brushforbox_brush[i].planes = brushforbox_plane + i * 6;
-               brushforpoint_brush[i].supercontents = SUPERCONTENTS_SOLID;
                brushforpoint_brush[i].numpoints = 1;
                brushforpoint_brush[i].numplanes = 0;
                brushforpoint_brush[i].points = brushforbox_point + i * 8;
index 440c412..3288b9f 100644 (file)
@@ -857,12 +857,6 @@ static void Mod_Q1BSP_TraceBox(struct model_s *model, int frame, trace_t *trace,
        else
                Mod_Q1BSP_RecursiveHullCheckPoint(&rhc, rhc.hull->firstclipnode);
 #endif
-       if (trace->fraction == 1)
-       {
-               trace->hitsupercontents = 0;
-               trace->hitq3surfaceflags = 0;
-               trace->hittexture = NULL;
-       }
 }
 
 void Collision_ClipTrace_Box(trace_t *trace, const vec3_t cmins, const vec3_t cmaxs, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int hitsupercontentsmask, int boxsupercontents, int boxq3surfaceflags, texture_t *boxtexture)
index 99e1f60..e89415f 100644 (file)
--- a/sv_move.c
+++ b/sv_move.c
@@ -51,7 +51,7 @@ qboolean SV_CheckBottom (prvm_edict_t *ent)
                {
                        start[0] = x ? maxs[0] : mins[0];
                        start[1] = y ? maxs[1] : mins[1];
-                       if (!(SV_PointSuperContents(start) & SUPERCONTENTS_SOLID))
+                       if (!(SV_PointSuperContents(start) & (SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY)))
                                goto realcheck;
                }