Linedefs which erroneously include a second sidedef, despite their being used as a boundary with the void (i.e., where a one-sided line should have been used) would result in degenerate BspLeafs on the back side of the line. Degenerate leaves significantly compromise the integrity of the BSP and result in obscure crashes or rendering glitches (callers of GameMap_BspLeafAtPoint() are particularly vulnerable).
Instead degenerate leaves are now "collapsed" into the BSP tree as we go - no BspLeaf is produced and the parent BSP node rewired to remove the parent partition. The linedef's links to the back sector and sidedef are also removed.
This fixes a variety of issues including obscure crashes when a thinker/mobj enters or is spawned into a degenerate BSP leaf and map rendering glitches such as those seen Aliens TC E2M1.
Bsp Builder: Automatically collapse degenerate leaves
Linedefs which erroneously include a second sidedef, despite their
being used as a boundary with the void (i.e., where a one-sided line
should have been used) would result in degenerate BspLeafs on the
back side of the line. Degenerate leaves significantly compromise
the integrity of the BSP and result in obscure crashes or rendering
glitches (callers of GameMap_BspLeafAtPoint() are particularly
vulnerable).
Instead degenerate leaves are now "collapsed" into the BSP tree as
we go - no BspLeaf is produced and the parent BSP node rewired to
remove the parent partition. The linedef's links to the back sector
and sidedef are also removed.
This fixes a variety of issues including obscure crashes when a
thinker/mobj enters or is spawned into a degenerate BSP leaf and map
rendering glitches such as those seen Aliens TC E2M1.