--- utils/glvis/level.cpp 2006-07-17 20:10:28.000000000 +0200 +++ utils/glvis/level.cpp 2006-08-01 19:04:08.000000000 +0200 @@ -537,6 +537,14 @@ subsector_t *sub = &subsectors[line->leaf]; if (line->partner) { + // Skip self-referencing subsector segs + if (line->leaf == line->partner->leaf) + { + Owner.DisplayMessage("Self-referencing subsector detected\n"); + numportals--; + continue; + } + // create portal if (sub->numportals == MAX_PORTALS_ON_LEAF) throw GLVisError("Leaf with too many portals");