diff --git a/qbsp/qbsp.h b/qbsp/qbsp.h index 32b183f2..decc5a6c 100644 --- a/qbsp/qbsp.h +++ b/qbsp/qbsp.h @@ -396,6 +396,7 @@ typedef struct surface_s { vec3_t mins, maxs; bool onnode; // true if surface has already been used // as a splitting node + bool detail_separator; // true if generated by a detail brush face_t *faces; // links to all faces on either side of the surf } surface_t; @@ -420,6 +421,7 @@ typedef struct node_s { int visleafnum; // -1 = solid int valid; // for flood filling int occupied; // entity number in leaf for outside filling + bool detail_separator; // for vis portal generation } node_t; //============================================================================= diff --git a/qbsp/solidbsp.c b/qbsp/solidbsp.c index aa7cf83a..1f6972f2 100644 --- a/qbsp/solidbsp.c +++ b/qbsp/solidbsp.c @@ -358,8 +358,10 @@ ChoosePlaneFromList(surface_t *surfaces, vec3_t mins, vec3_t maxs) } /* If we found a candidate on first pass, don't do a second pass */ - if (bestsurface) + if (pass > 0 && bestsurface) { + bestsurface->detail_separator = true; break; + } } return bestsurface; @@ -704,6 +706,7 @@ PartitionSurfaces(surface_t *surfaces, node_t *node) node->children[0] = AllocMem(NODE, 1, true); node->children[1] = AllocMem(NODE, 1, true); node->planenum = split->planenum; + node->detail_separator = split->detail_separator; splitplane = &map.planes[split->planenum];