diff --git a/src/gl/scene/gl_sky.cpp b/src/gl/scene/gl_sky.cpp index 19d1c9127..7fe92b890 100644 --- a/src/gl/scene/gl_sky.cpp +++ b/src/gl/scene/gl_sky.cpp @@ -289,7 +289,7 @@ void GLWall::SkyTop(seg_t * seg,sector_t * fs,sector_t * bs,vertex_t * v1,vertex if (frontreflect > 0) { float backreflect = bs->GetReflect(sector_t::ceiling); - if (backreflect > 0 && bs->ceilingplane.fD() == fs->ceilingplane.fD()) + if (backreflect > 0 && bs->ceilingplane.fD() == fs->ceilingplane.fD() && !bs->isClosed()) { // Don't add intra-portal line to the portal. return; @@ -368,7 +368,7 @@ void GLWall::SkyBottom(seg_t * seg,sector_t * fs,sector_t * bs,vertex_t * v1,ver if (frontreflect > 0) { float backreflect = bs->GetReflect(sector_t::floor); - if (backreflect > 0 && bs->floorplane.fD() == fs->floorplane.fD()) + if (backreflect > 0 && bs->floorplane.fD() == fs->floorplane.fD() && !bs->isClosed()) { // Don't add intra-portal line to the portal. return; diff --git a/src/r_defs.h b/src/r_defs.h index abf43fdf1..2c1a7cfcb 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -955,6 +955,11 @@ public: return LowestFloorAt(a->Pos(), resultsec); } + bool isClosed() const + { + return floorplane.Normal() == -ceilingplane.Normal() && floorplane.D == -ceilingplane.D; + } + double NextHighestCeilingAt(double x, double y, double bottomz, double topz, int flags = 0, sector_t **resultsec = NULL, F3DFloor **resultffloor = NULL); double NextLowestFloorAt(double x, double y, double z, int flags = 0, double steph = 0, sector_t **resultsec = NULL, F3DFloor **resultffloor = NULL);