From d65dc77ac73a77b209c21f3236cbf5f2c05f5f96 Mon Sep 17 00:00:00 2001 From: Kevin Shanahan Date: Tue, 5 Mar 2013 16:01:25 +1030 Subject: [PATCH] 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 --- qbsp/outside.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/qbsp/outside.c b/qbsp/outside.c index ea9a09c1..ff82e619 100644 --- a/qbsp/outside.c +++ b/qbsp/outside.c @@ -142,16 +142,13 @@ MarkLeakTrail */ __attribute__((noinline)) static void -MarkLeakTrail(portal_t *n2, const int hullnum, const int numportals) +MarkLeakTrail(portal_t *n2, const int numportals) { int i; vec3_t p1, p2; portal_t *n1; vec_t *v; - if (hullnum != 2) - return; - if (numleaks > numportals) 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]) { side = (p->nodes[0] == node); if (RecursiveFillOutside(p->nodes[side], fill, hullnum, numportals)) { - // leaked, so stop filling - if (backdraw-- > 0) - MarkLeakTrail(p, hullnum, numportals); + /* leaked, so stop filling */ + if (backdraw) { + backdraw--; + if (hullnum == 2) /* FIXME!!! */ + MarkLeakTrail(p, numportals); + } return true; } }