qbsp: lift the hullnum check out of MarkLeakTrail

Makes it kind of obvious now that there is a bug here - if we have a small
leak in hull 0 or 1 which is sealed in hull 2 (due to brush expansion), then
we won't get a leak trail!

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
Kevin Shanahan 2013-03-05 16:01:25 +10:30
parent 75ef5aa9d8
commit d65dc77ac7
1 changed files with 7 additions and 7 deletions

View File

@ -142,16 +142,13 @@ MarkLeakTrail
*/ */
__attribute__((noinline)) __attribute__((noinline))
static void static void
MarkLeakTrail(portal_t *n2, const int hullnum, const int numportals) MarkLeakTrail(portal_t *n2, const int numportals)
{ {
int i; int i;
vec3_t p1, p2; vec3_t p1, p2;
portal_t *n1; portal_t *n1;
vec_t *v; vec_t *v;
if (hullnum != 2)
return;
if (numleaks > numportals) if (numleaks > numportals)
Error(errLowLeakCount); Error(errLowLeakCount);
@ -353,9 +350,12 @@ RecursiveFillOutside(node_t *node, bool fill, const int hullnum, const int numpo
for (p = node->portals; p; p = p->next[!side]) { for (p = node->portals; p; p = p->next[!side]) {
side = (p->nodes[0] == node); side = (p->nodes[0] == node);
if (RecursiveFillOutside(p->nodes[side], fill, hullnum, numportals)) { if (RecursiveFillOutside(p->nodes[side], fill, hullnum, numportals)) {
// leaked, so stop filling /* leaked, so stop filling */
if (backdraw-- > 0) if (backdraw) {
MarkLeakTrail(p, hullnum, numportals); backdraw--;
if (hullnum == 2) /* FIXME!!! */
MarkLeakTrail(p, numportals);
}
return true; return true;
} }
} }