From 81cf1cc99d60be6c5b001bd40a2cd9c03354e126 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 25 Mar 2003 16:34:07 +0000 Subject: [PATCH] don't seg on hint and skip brushs. hint and clip brushes are now known to work (what is a skip brush?) --- tools/qfbsp/source/brush.c | 39 ++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/tools/qfbsp/source/brush.c b/tools/qfbsp/source/brush.c index 4e97240f8..ae08858b9 100644 --- a/tools/qfbsp/source/brush.c +++ b/tools/qfbsp/source/brush.c @@ -567,27 +567,34 @@ LoadBrush (mbrush_t *mb, int hullnum) mface_t *f; // check texture name for attributes - name = miptex[bsp->texinfo[mb->faces->texinfo].miptex]; + if (mb->faces->texinfo < 0) { + // ignore HINT and SKIP in clip hulls + if (hullnum) + return NULL; + contents = CONTENTS_EMPTY; + } else { + name = miptex[bsp->texinfo[mb->faces->texinfo].miptex]; - if (!strcasecmp (name, "clip") && hullnum == 0) - return NULL; // "clip" brushes don't show up in the draw hull + if (!strcasecmp (name, "clip") && hullnum == 0) + return NULL; // "clip" brushes don't show up in the draw hull - if (name[0] == '*' && worldmodel) { // entities never use water merging - if (!strncasecmp (name + 1, "lava", 4)) - contents = CONTENTS_LAVA; - else if (!strncasecmp (name + 1, "slime", 5)) - contents = CONTENTS_SLIME; + if (name[0] == '*' && worldmodel) { // entities never use water merging + if (!strncasecmp (name + 1, "lava", 4)) + contents = CONTENTS_LAVA; + else if (!strncasecmp (name + 1, "slime", 5)) + contents = CONTENTS_SLIME; + else + contents = CONTENTS_WATER; + } else if (!strncasecmp (name, "sky", 3) && worldmodel && hullnum == 0) + contents = CONTENTS_SKY; else - contents = CONTENTS_WATER; - } else if (!strncasecmp (name, "sky", 3) && worldmodel && hullnum == 0) - contents = CONTENTS_SKY; - else - contents = CONTENTS_SOLID; + contents = CONTENTS_SOLID; - if (hullnum && contents != CONTENTS_SOLID && contents != CONTENTS_SKY) - return NULL; // water brushes don't show up in clipping hulls + if (hullnum && contents != CONTENTS_SOLID && contents != CONTENTS_SKY) + return NULL; // water brushes don't show up in clipping hulls - // no seperate textures on clip hull + // no seperate textures on clip hull + } // create the faces brush_faces = NULL;