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))
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;
}
}