- if (info->exact)
- {
- int j;
- const int *elements;
- const float *vertex3f;
- float v[9];
- vertex3f = info->model->surfmesh.data_vertex3f;
- elements = (info->model->surfmesh.data_element3i + 3 * surface->num_firsttriangle);
- for (j = 0;j < surface->num_triangles;j++, elements += 3)
- {
- VectorCopy(vertex3f + elements[0] * 3, v + 0);
- VectorCopy(vertex3f + elements[1] * 3, v + 3);
- VectorCopy(vertex3f + elements[2] * 3, v + 6);
- if (PointInfrontOfTriangle(info->eye, v + 0, v + 3, v + 6) && TriangleOverlapsBox(v, v + 3, v + 6, info->boxmins, info->boxmaxs) && Portal_PortalThroughPortalPlanes(&portalplanes[firstclipplane], numclipplanes, v, 3, &portaltemppoints2[0][0], 256) > 0)
- {
- SETPVSBIT(info->surfacepvs, surfaceindex);
- info->surfacelist[info->numsurfaces++] = surfaceindex;
- break;
- }
- }
- }
- else
+ VectorCopy(vertex3f + elements[0] * 3, v + 0);
+ VectorCopy(vertex3f + elements[1] * 3, v + 3);
+ VectorCopy(vertex3f + elements[2] * 3, v + 6);
+ if (PointInfrontOfTriangle(info->eye, v + 0, v + 3, v + 6)
+ && (insidebox || TriangleBBoxOverlapsBox(v, v + 3, v + 6, info->boxmins, info->boxmaxs))
+ && (!info->exact || Portal_PortalThroughPortalPlanes(&portalplanes[firstclipplane], numclipplanes, v, 3, &portaltemppoints2[0][0], 256) > 0))