+
+ // don't try to cull embedded brush models with this, they're sometimes huge (spanning several rooms)
+ if (sv_cullentities_trace.integer && (model->type != mod_brush || model->name[0] != '*'))
+ {
+ // LordHavoc: test random offsets, to maximize chance of detection
+ testorigin[0] = lhrandom(entmins[0], entmaxs[0]);
+ testorigin[1] = lhrandom(entmins[1], entmaxs[1]);
+ testorigin[2] = lhrandom(entmins[2], entmaxs[2]);
+
+ memset (&trace, 0, sizeof(trace_t));
+ trace.fraction = 1;
+ trace.allsolid = true;
+ VectorCopy(testorigin, trace.endpos);
+
+ VectorCopy(org, RecursiveHullCheckInfo.start);
+ VectorSubtract(testorigin, org, RecursiveHullCheckInfo.dist);
+ RecursiveHullCheckInfo.hull = sv.worldmodel->hulls;
+ RecursiveHullCheckInfo.trace = &trace;
+ SV_RecursiveHullCheck (sv.worldmodel->hulls->firstclipnode, 0, 1, org, testorigin);
+
+ if (trace.fraction == 1)
+ client->lastvisible[e] = realtime;
+ else
+ {
+ if (realtime - client->lastvisible[e] >= 1)
+ {
+ culled_trace++;
+ continue;
+ }
+ }
+ }
+ visibleentities++;