]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix a serious bug in R_Mesh_AddBrushMeshFromPlanes with maxdist not
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 23 Oct 2009 18:26:25 +0000 (18:26 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 23 Oct 2009 18:26:25 +0000 (18:26 +0000)
using fabs

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

gl_rmain.c

index cef68dc50b3089d41912d2068b995b84ddbcaa2e..12402b28fdf982a3f55c2fc4c2620ea888aa98f5 100644 (file)
@@ -5295,7 +5295,7 @@ void R_Mesh_AddBrushMeshFromPlanes(rmesh_t *mesh, int numplanes, mplane_t *plane
        // figure out how large a bounding box we need to properly compute this brush
        maxdist = 0;
        for (w = 0;w < numplanes;w++)
-               maxdist = max(maxdist, planes[w].dist);
+               maxdist = max(maxdist, fabs(planes[w].dist));
        // now make it large enough to enclose the entire brush, and round it off to a reasonable multiple of 1024
        maxdist = floor(maxdist * (4.0 / 1024.0) + 1) * 1024.0;
        for (planenum = 0, plane = planes;planenum < numplanes;planenum++, plane++)