trace.realfraction = 1;
if (ent->model && ent->model->TraceBox)
- ent->model->TraceBox(ent->model, 0, &trace, start, mins, maxs, endtransformed, hitsupercontentsmask);
+ ent->model->TraceBox(ent->model, 0, &trace, starttransformed, mins, maxs, endtransformed, hitsupercontentsmask);
// LordHavoc: take the 'best' answers from the new trace and combine with existing data
if (trace.allsolid)
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)
float CL_SelectTraceLine(const vec3_t start, const vec3_t end, vec3_t impact, vec3_t normal, int *hitent, entity_render_t *ignoreent, qboolean csqcents)
{
float maxfrac, maxrealfrac;
- int n, entsnum;
- entity_t *entlist;
- unsigned char *entactivelist;
+ int n;
entity_render_t *ent;
float tracemins[3], tracemaxs[3];
trace_t trace;
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);
tracemins[2] = min(start[2], end[2]);
tracemaxs[2] = max(start[2], end[2]);
- if(csqcents)
- {
- entlist = cl.csqcentities;
- entactivelist = cl.csqcentities_active;
- entsnum = cl.num_csqcentities;
- }
- else
+ if (csqcents)
{
- entlist = cl.entities;
- entactivelist = cl.entities_active;
- entsnum = cl.num_entities;
+ Con_Printf("CL_SelectTraceline: csqc entity collisions in this function are broken and this function will be removed in the future (it is not part of the csqc spec).\n");
+ return maxfrac;
}
// look for embedded bmodels
- for (n = 0;n < entsnum;n++)
+ for (n = 0;n < cl.num_entities;n++)
{
- if (!entactivelist[n])
+ if (!cl.entities_active[n])
continue;
- ent = &entlist[n].render;
+ ent = &cl.entities[n].render;
if (!BoxesOverlap(ent->mins, ent->maxs, tracemins, tracemaxs))
continue;
if (!ent->model || !ent->model->TraceBox)
if ((ent->flags & RENDER_EXTERIORMODEL) && !chase_active.integer)
continue;
// if transparent and not selectable, skip entity
- if (!(entlist[n].state_current.effects & EF_SELECTABLE) && (ent->alpha < 1 || (ent->effects & (EF_ADDITIVE | EF_NODEPTHTEST))))
+ if (!(cl.entities[n].state_current.effects & EF_SELECTABLE) && (ent->alpha < 1 || (ent->effects & (EF_ADDITIVE | EF_NODEPTHTEST))))
continue;
if (ent == ignoreent)
continue;
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)
{
cl.worldmodel->brush.FindNonSolidLocation(cl.worldmodel, in, out, radius);
}
-int CL_PointQ1Contents(const vec3_t p)
-{
- return Mod_Q1BSP_NativeContentsFromSuperContents(NULL, CL_TraceBox(p, vec3_origin, vec3_origin, p, true, NULL, 0, false).startsupercontents);
- /*
- // FIXME: check multiple brush models
- if (cl.worldmodel && cl.worldmodel->brush.PointContentsQ1)
- return cl.worldmodel->brush.PointContentsQ1(cl.worldmodel, p);
- return 0;
- */
-}
-
int CL_PointSuperContents(const vec3_t p)
{
return CL_TraceBox(p, vec3_origin, vec3_origin, p, true, NULL, 0, false).startsupercontents;
- /*
- // FIXME: check multiple brush models
- if (cl.worldmodel && cl.worldmodel->brush.PointContentsQ1)
- return cl.worldmodel->brush.PointContentsQ1(cl.worldmodel, p);
- return 0;
- */
}