Skip to content

Commit

Permalink
Fixed|World|SectorCluster: Crash with sci2.wad (Doom2) upon triggerin…
Browse files Browse the repository at this point in the history
…g the exit crusher

The crash was the result of an incorrect assumption that all sector
clusters will have at least one outer boundary edge. While this is
logically true there are some special cases in which no boundary is
recorded (e.g., the one unique outer halfedge is twined with an egde
originating from a degenerate BSP leaf). In this case, the trigger
is a so-called "control sector" outside the map attempting to update
surface light decorations when it's ceiling plane moved.

Todo for later: There is no need for such a cluster to be observing
plane movement at all. To address this properly we need two things;
1) BSP building algorithm that guarantees topologically sound and
geometrically correct data, 2) more intelligent SectorCluster.

IssueID #1791
  • Loading branch information
danij-deng committed May 3, 2014
1 parent 4a78edb commit 88e6641
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions doomsday/client/src/world/sectorcluster.cpp
Expand Up @@ -624,15 +624,19 @@ DENG2_PIMPL(SectorCluster)
initBoundaryInfoIfNeeded();

// Mark surfaces of the outer edge loop.
HEdge *base = boundaryInfo->uniqueOuterEdges.first();
SectorClusterCirculator it(base);
do
/// @todo What about the special case of a cluster with no outer neighbors? -ds
if(!boundaryData->uniqueOuterEdges.isEmpty())
{
if(it->hasMapElement()) // BSP errors may fool the circulator wrt interior edges -ds
HEdge *base = boundaryInfo->uniqueOuterEdges.first();
SectorClusterCirculator it(base);
do
{
markAllSurfacesForDecorationUpdate(it->mapElementAs<LineSideSegment>().line());
}
} while(&it.next() != base);
if(it->hasMapElement()) // BSP errors may fool the circulator wrt interior edges -ds
{
markAllSurfacesForDecorationUpdate(it->mapElementAs<LineSideSegment>().line());
}
} while(&it.next() != base);
}

// Mark surfaces of the inner edge loop(s).
foreach(HEdge *base, boundaryInfo->uniqueInnerEdges)
Expand Down

0 comments on commit 88e6641

Please sign in to comment.