From e39c8f9cf65b2288c9cfbcbf734657abcc769128 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Mon, 20 Jun 2022 23:05:56 -0600 Subject: [PATCH] qbsp: fix simple_worldspawn_detail_wall --- common/bspfile.cc | 4 ++++ qbsp/merge.cc | 2 +- qbsp/surfaces.cc | 6 ++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/common/bspfile.cc b/common/bspfile.cc index 52494798..0c888439 100644 --- a/common/bspfile.cc +++ b/common/bspfile.cc @@ -381,6 +381,10 @@ public: bool directional_visible_contents(const contentflags_t &a, const contentflags_t &b) const override { + if (contents_priority(b) > contents_priority(a)) { + return true; + } + if (a.is_empty(this)) { // empty can always see whatever is in `b` return true; diff --git a/qbsp/merge.cc b/qbsp/merge.cc index dc4f5184..1c6f298c 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 9f509eb0..008b5301 100644 --- a/qbsp/surfaces.cc +++ b/qbsp/surfaces.cc @@ -769,12 +769,14 @@ static face_t *FaceFromPortal(portal_t *p, int pside) { f->w = p->winding->flip(); // fixme-brushbsp: was just `f->contents` on qbsp3 - f->contents[1] = p->nodes[1]->contents; + f->contents[0] = p->nodes[1]->contents; + f->contents[1] = p->nodes[0]->contents; } else { f->w = *p->winding; - f->contents[1] = p->nodes[0]->contents; + f->contents[0] = p->nodes[0]->contents; + f->contents[1] = p->nodes[1]->contents; } UpdateFaceSphere(f);