From 9f1f17c306222ffb186eccfccb89fdbf78ba7ff1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 14 Oct 2014 08:54:08 +0200 Subject: [PATCH] - fixed: The PolyBSPs weren't fully initialized. Some GZDoom-only fields in the segs were skipped. --- src/gl/scene/gl_bsp.cpp | 5 +++++ src/gl/scene/gl_walls.cpp | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gl/scene/gl_bsp.cpp b/src/gl/scene/gl_bsp.cpp index 4de31bd61..dd6df8287 100644 --- a/src/gl/scene/gl_bsp.cpp +++ b/src/gl/scene/gl_bsp.cpp @@ -267,6 +267,11 @@ static void AddPolyobjs(subsector_t *sub) if (sub->BSP == NULL || sub->BSP->bDirty) { sub->BuildPolyBSP(); + for (unsigned i = 0; i < sub->BSP->Segs.Size(); i++) + { + sub->BSP->Segs[i].Subsector = sub; + sub->BSP->Segs[i].PartnerSeg = NULL; + } } if (sub->BSP->Nodes.Size() == 0) { diff --git a/src/gl/scene/gl_walls.cpp b/src/gl/scene/gl_walls.cpp index 94386c9a5..2e784b857 100644 --- a/src/gl/scene/gl_walls.cpp +++ b/src/gl/scene/gl_walls.cpp @@ -1631,7 +1631,7 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector) else if (!(seg->sidedef->Flags & WALLF_POLYOBJ)) { // skip processing if the back is a malformed subsector - if (!(seg->PartnerSeg->Subsector->hacked & 4)) + if (seg->PartnerSeg != NULL && !(seg->PartnerSeg->Subsector->hacked & 4)) { gl_drawinfo->AddUpperMissingTexture(seg->sidedef, sub, bch1a); } @@ -1704,7 +1704,7 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector) !(seg->sidedef->Flags & WALLF_POLYOBJ)) { // skip processing if the back is a malformed subsector - if (!(seg->PartnerSeg->Subsector->hacked & 4)) + if (seg->PartnerSeg != NULL && !(seg->PartnerSeg->Subsector->hacked & 4)) { gl_drawinfo->AddLowerMissingTexture(seg->sidedef, sub, bfh1); }