From: havoc Date: Fri, 23 Oct 2009 18:26:25 +0000 (+0000) Subject: fix a serious bug in R_Mesh_AddBrushMeshFromPlanes with maxdist not X-Git-Tag: xonotic-v0.1.0preview~1245 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=24dc8f4f68c57d500a0f97c5d6834be22b27c604;p=xonotic%2Fdarkplaces.git fix a serious bug in R_Mesh_AddBrushMeshFromPlanes with maxdist not using fabs git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9393 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rmain.c b/gl_rmain.c index cef68dc5..12402b28 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -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++)