for (n = 0;n < cl_num_brushmodel_entities;n++)
{
ent = cl_brushmodel_entities[n];
- if (ent->mins[0] > tracemaxs[0] || ent->maxs[0] < tracemins[0]
- || ent->mins[1] > tracemaxs[1] || ent->maxs[1] < tracemins[1]
- || ent->mins[2] > tracemaxs[2] || ent->maxs[2] < tracemins[2])
+ if (!BoxesOverlap(tracemins, tracemaxs, ent->mins, ent->maxs))
continue;
Matrix4x4_Transform(&ent->inversematrix, start, starttransformed);
return maxfrac;
}
-float CL_SelectTraceLine(const vec3_t start, const vec3_t end, vec3_t impact, vec3_t normal, int *hitent)
+float CL_SelectTraceLine(const vec3_t start, const vec3_t end, vec3_t impact, vec3_t normal, int *hitent, entity_render_t *ignoreent)
{
float maxfrac, maxrealfrac;
int n;
// if transparent and not selectable, skip entity
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, start, starttransformed);
Matrix4x4_Transform(&ent->inversematrix, end, endtransformed);
extern int cl_traceline_startcontents; // set by TraceLine
float CL_TraceLine(const vec3_t start, const vec3_t end, vec3_t impact, vec3_t normal, int hitbmodels, entity_render_t **hitent, int hitsupercontentsmask);
-float CL_SelectTraceLine(const vec3_t start, const vec3_t end, vec3_t impact, vec3_t normal, int *hitent);
+float CL_SelectTraceLine(const vec3_t start, const vec3_t end, vec3_t impact, vec3_t normal, int *hitent, entity_render_t *ignoreent);
void CL_FindNonSolidLocation(const vec3_t in, vec3_t out, vec_t radius);
int CL_PointQ1Contents(const vec3_t p);
int CL_PointSuperContents(const vec3_t p);
VectorCopy(r_vieworigin, cl.cmd.cursor_start);
VectorSet(temp, cl.cmd.cursor_screen[2] * scale[2], cl.cmd.cursor_screen[0] * scale[0], cl.cmd.cursor_screen[1] * scale[1]);
Matrix4x4_Transform(&r_view_matrix, temp, cl.cmd.cursor_end);
- cl.cmd.cursor_fraction = CL_SelectTraceLine(cl.cmd.cursor_start, cl.cmd.cursor_end, cl.cmd.cursor_impact, cl.cmd.cursor_normal, &cl.cmd.cursor_entitynumber);
+ cl.cmd.cursor_fraction = CL_SelectTraceLine(cl.cmd.cursor_start, cl.cmd.cursor_end, cl.cmd.cursor_impact, cl.cmd.cursor_normal, &cl.cmd.cursor_entitynumber, (chase_active.integer || cl.intermission) ? &cl_entities[cl.playerentity].render : NULL);
// makes sparks where cursor is
//CL_SparkShower(cl.cmd.cursor_impact, cl.cmd.cursor_normal, 5, 0);
}