Skip to content

Commit

Permalink
Map Importer: Adjusted self-referencing loop detection
Browse files Browse the repository at this point in the history
IssueID #2370
  • Loading branch information
skyjake committed Jan 5, 2020
1 parent 92d8a28 commit 341ddc2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions doomsday/apps/plugins/importidtech1/src/mapimporter.cpp
Expand Up @@ -347,6 +347,7 @@ struct SectorDef : public Id1MapElement
// Internal bookkeeping:
std::set<int> lines;
std::vector<int> selfRefLoop;
int singleSidedCount = 0;
int hackFlags = 0;
struct de_api_sector_hacks_s hackParams{{0, 0}, -1};

Expand Down Expand Up @@ -1317,6 +1318,7 @@ DENG2_PIMPL(MapImporter)
if (!line.isTwoSided())
{
hasSingleSided = true;
sector.singleSidedCount++;
}
if (isSelfReferencing(line))
{
Expand Down Expand Up @@ -1352,6 +1354,13 @@ DENG2_PIMPL(MapImporter)
qDebug(" line %d", lineIndex);
}
sector.hackFlags |= HACK_HAS_SELF_REFERENCING_LOOP;
if (sector.singleSidedCount > int(loop.size()))
{
qDebug(" but the sector has %d single-sided lines, so ignoring the loop",
sector.singleSidedCount);
sector.hackFlags &= ~HACK_HAS_SELF_REFERENCING_LOOP;
sector.selfRefLoop.clear();
}
break;
}
}
Expand Down

0 comments on commit 341ddc2

Please sign in to comment.