- added a check for unconnected linked line portals.

This commit is contained in:
Christoph Oelckers 2017-05-13 17:45:24 +02:00
parent f0d40d6a8a
commit b346dd0c09

View file

@ -1026,11 +1026,20 @@ void P_CreateLinkedPortals()
for (unsigned i = 0; i < linePortals.Size(); i++)
{
if (linePortals[i].mType == PORTT_LINKED)
{
if (linePortals[i].mDestination == nullptr)
{
Printf("Linked portal on line %d is unconnected and will be disabled\n", linePortals[i].mOrigin->Index());
linePortals[i].mOrigin->portalindex = UINT_MAX;
linePortals[i].mType = PORTT_VISUAL;
}
else
{
if (CollectSectors(id, linePortals[i].mOrigin->frontsector)) id++;
if (CollectSectors(id, linePortals[i].mDestination->frontsector)) id++;
}
}
}
Displacements.Create(id);
// Check for leftover sectors that connect to a portal