From 84e007b7ce5f5b1f1e658305450bf1acc6c8615d Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Tue, 21 Jun 2022 00:39:07 -0600 Subject: [PATCH] qbsp: fix noclipfaces tests --- qbsp/merge.cc | 2 +- qbsp/surfaces.cc | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/qbsp/merge.cc b/qbsp/merge.cc index 1c6f298c..af1a8f4d 100644 --- a/qbsp/merge.cc +++ b/qbsp/merge.cc @@ -69,7 +69,7 @@ static face_t *TryMerge(face_t *f1, face_t *f2) bool keep1, keep2; if (!f1->w.size() || !f2->w.size() || f1->planeside != f2->planeside || f1->texinfo != f2->texinfo || - /*!f1->contents[0].equals(options.target_game, f2->contents[0]) ||*/ !f1->contents[1].equals(options.target_game, f2->contents[1]) || + /*!f1->contents[0].equals(options.target_game, f2->contents[0]) || !f1->contents[1].equals(options.target_game, f2->contents[1]) || */ f1->lmshift[0] != f2->lmshift[0] || f1->lmshift[1] != f2->lmshift[1]) return NULL; diff --git a/qbsp/surfaces.cc b/qbsp/surfaces.cc index 008b5301..2f102567 100644 --- a/qbsp/surfaces.cc +++ b/qbsp/surfaces.cc @@ -765,6 +765,17 @@ static face_t *FaceFromPortal(portal_t *p, int pside) return nullptr; } + if (!p->nodes[pside]->contents.is_empty(options.target_game)) { + bool our_contents_mirrorinside = options.target_game->contents_are_mirrored(p->nodes[pside]->contents); + if (!our_contents_mirrorinside) { + if (side->planeside != pside) { + + return nullptr; + } + } + } + + if (pside) { f->w = p->winding->flip();