From 24dc8f4f68c57d500a0f97c5d6834be22b27c604 Mon Sep 17 00:00:00 2001 From: havoc Date: Fri, 23 Oct 2009 18:26:25 +0000 Subject: [PATCH] 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 --- gl_rmain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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++) -- 2.39.2