From bb02e6d20a4e24584baf6d7854192da2ff84e248 Mon Sep 17 00:00:00 2001 From: Kevin Shanahan Date: Sun, 21 Apr 2013 13:05:11 +0930 Subject: [PATCH] qbsp: fix portal generation mixed water/empty detail clusters We don't want to terminate the recursion in ClusterContents when we reach a non-detail separator because we need to know the contents of the leafs! This was working okay for simple cases but fails when the detail clusters become more complex. Signed-off-by: Kevin Shanahan --- changelog.txt | 1 + qbsp/portals.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/changelog.txt b/changelog.txt index 322757e7..ef1230fb 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,7 @@ Unreleased * qbsp: fixed surface edge corruption when using skip surfaces +* qbsp: fixed portal generation for transparent water and detail nodes * qbsp: added "-noskip" option for troubleshooting skip related problems * vis: fix portal stack corruption in ClipStackWinding * bsputil: added a "--check" option to check internal data consistency diff --git a/qbsp/portals.c b/qbsp/portals.c index 4bb8425a..239b0545 100644 --- a/qbsp/portals.c +++ b/qbsp/portals.c @@ -54,8 +54,8 @@ ClusterContents(const node_t *node) { int contents0, contents1; - /* Either a leaf or non-detail node */ - if (node->contents || !node->detail_separator) + /* Pass the leaf contents up the stack */ + if (node->contents) return node->contents; contents0 = ClusterContents(node->children[0]);