diff --git a/src/gl/data/gl_setup.cpp b/src/gl/data/gl_setup.cpp index fc63cb95b5..5e6e0767b1 100644 --- a/src/gl/data/gl_setup.cpp +++ b/src/gl/data/gl_setup.cpp @@ -233,6 +233,7 @@ static void SpreadHackedFlag(subsector_t * sub) if (!(sub2->hacked&1) && sub2->render_sector == sub->render_sector) { sub2->hacked|=1; + sub->hacked &= ~4; SpreadHackedFlag (sub2); } } @@ -285,7 +286,7 @@ static void PrepareSectorData() subsectors[i].render_sector != seg[j].PartnerSeg->Subsector->render_sector) { DPrintf("Found hack: (%d,%d) (%d,%d)\n", seg[j].v1->x>>16, seg[j].v1->y>>16, seg[j].v2->x>>16, seg[j].v2->y>>16); - subsectors[i].hacked|=1; + subsectors[i].hacked|=5; SpreadHackedFlag(&subsectors[i]); } if (seg[j].PartnerSeg==NULL) subsectors[i].hacked|=2; // used for quick termination checks diff --git a/src/gl/scene/gl_walls.cpp b/src/gl/scene/gl_walls.cpp index bb160a790f..e86b03d490 100644 --- a/src/gl/scene/gl_walls.cpp +++ b/src/gl/scene/gl_walls.cpp @@ -1417,7 +1417,7 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector) sector_t * realback; #ifdef _DEBUG - if (seg->linedef-lines==636) + if (seg->linedef-lines==1276) { int a = 0; } @@ -1635,7 +1635,11 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector) } else if (!(seg->sidedef->Flags & WALLF_POLYOBJ)) { - gl_drawinfo->AddUpperMissingTexture(seg->sidedef, sub, bch1a); + // skip processing if the back is a malformed subsector + if (!(seg->PartnerSeg->Subsector->hacked & 4)) + { + gl_drawinfo->AddUpperMissingTexture(seg->sidedef, sub, bch1a); + } } } } @@ -1704,7 +1708,11 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector) else if (backsector->GetTexture(sector_t::floor) != skyflatnum && !(seg->sidedef->Flags & WALLF_POLYOBJ)) { - gl_drawinfo->AddLowerMissingTexture(seg->sidedef, sub, bfh1); + // skip processing if the back is a malformed subsector + if (!(seg->PartnerSeg->Subsector->hacked & 4)) + { + gl_drawinfo->AddLowerMissingTexture(seg->sidedef, sub, bfh1); + } } } }