diff --git a/src/playsim/p_sectors.cpp b/src/playsim/p_sectors.cpp index bc31156a6..b0aba23c1 100644 --- a/src/playsim/p_sectors.cpp +++ b/src/playsim/p_sectors.cpp @@ -1497,6 +1497,12 @@ void subsector_t::BuildPolyBSP() BSP->Subsectors[i].sector = sector; BSP->Subsectors[i].section = section; } + for (unsigned i = 0; i < BSP->Segs.Size(); i++) + { + BSP->Segs[i].Subsector = this; + BSP->Segs[i].PartnerSeg = nullptr; + } + } //=========================================================================== diff --git a/src/rendering/hwrenderer/scene/hw_bsp.cpp b/src/rendering/hwrenderer/scene/hw_bsp.cpp index 8a1a63a33..8f6f1e194 100644 --- a/src/rendering/hwrenderer/scene/hw_bsp.cpp +++ b/src/rendering/hwrenderer/scene/hw_bsp.cpp @@ -429,11 +429,6 @@ void HWDrawInfo::AddPolyobjs(subsector_t *sub) if (sub->BSP == nullptr || 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 = nullptr; - } } if (sub->BSP->Nodes.Size() == 0) {