Skip to content

Commit

Permalink
Fixed: Crash attempting to play maps containing a single subsector
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Jun 27, 2012
1 parent 151f3be commit fbfa49f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions doomsday/engine/portable/src/edit_bsp.cpp
Expand Up @@ -219,7 +219,9 @@ static void hardenBSP(BspBuilder& builder, GameMap* dest)
dest->bspLeafs = static_cast<BspLeaf**>(Z_Calloc(dest->numBspLeafs * sizeof(BspLeaf*), PU_MAPSTATIC, 0));

BspTreeNode* rootNode = builder.root();
if(rootNode && rootNode->isLeaf())
dest->bsp = rootNode->userData();

if(rootNode->isLeaf())
{
// Take ownership of this leaf.
Q_ASSERT(rootNode->userData());
Expand All @@ -229,11 +231,10 @@ static void hardenBSP(BspBuilder& builder, GameMap* dest)
// Add this BspLeaf to the LUT.
leaf->index = 0;
dest->bspLeafs[0] = leaf;

return;
}

dest->bsp = rootNode->userData();

populatebspobjectluts_params_t p;
p.builder = &builder;
p.dest = dest;
Expand Down

0 comments on commit fbfa49f

Please sign in to comment.