From: Forest Hale <lordhavoc>
Date: Fri, 9 Mar 2007 01:57:32 +0000 (+0000)
Subject: changed BaseWindingForPlane to construct the polygon using
X-Git-Tag: xonotic-v0.7.0~16^2~12^2~138
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=77faf8018f91f32b02f2545ed2364dddca4d687b;p=xonotic%2Fnetradiant.git

changed BaseWindingForPlane to construct the polygon using
MAX_WORLD_COORD*2 as radius rather than MAX_WORLD_COORD, this fixes
problems with certain invalid brushes not being rejected because of
insufficiently large coords, usually causing a stack overflow when
constructing the BSP tree (due to insufficient "_blocksize")


git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@156 8a3a26a2-13c4-0310-b231-cf6edde360e5
---

diff --git a/tools/quake3/common/polylib.c b/tools/quake3/common/polylib.c
index 55824299..21067ca2 100644
--- a/tools/quake3/common/polylib.c
+++ b/tools/quake3/common/polylib.c
@@ -249,8 +249,11 @@ winding_t *BaseWindingForPlane (vec3_t normal, vec_t dist)
 	
 	CrossProduct (vup, normal, vright);
 	
-	VectorScale (vup, MAX_WORLD_COORD, vup);
-	VectorScale (vright, MAX_WORLD_COORD, vright);
+	// LordHavoc: this has to use *2 because otherwise some created points may
+	// be inside the world (think of a diagonal case), and any brush with such
+	// points should be removed, failure to detect such cases is disasterous
+	VectorScale (vup, MAX_WORLD_COORD*2, vup);
+	VectorScale (vright, MAX_WORLD_COORD*2, vright);
 
   // project a really big	axis aligned box onto the plane
 	w = AllocWinding (4);