Fix CheckAndMakePortal missing tagged sectors

This commit is contained in:
RaveYard 2022-10-31 02:19:11 +01:00
parent e8e339c8f7
commit b003565ad2
3 changed files with 19 additions and 3 deletions

View file

@ -156,6 +156,7 @@ struct IntSector
TArray<UDMFKey> props;
TArray<IntLineDef*> lines;
TArray<IntLineDef*> portals;
// Utility functions
inline const char* GetTextureName(int plane) const { return plane != PLANE_FLOOR ? data.ceilingpic : data.floorpic; }

View file

@ -674,6 +674,23 @@ void FLevel::PostLoadInitialization()
line->frontsector = (line->sidenum[0] != NO_INDEX) ? &Sectors[Sides[line->sidenum[0]].sector] : nullptr;
line->backsector = (line->sidenum[1] != NO_INDEX) ? &Sectors[Sides[line->sidenum[1]].sector] : nullptr;
}
// Find plane portals
{
for (auto& line : Lines)
{
if (line.special == Sector_SetPortal && line.args[0])
{
for (auto& sector : Sectors)
{
if (sector.HasTag(line.args[0]))
{
sector.portals.Push(&line);
}
}
}
}
}
}
void FProcessor::BuildNodes()

View file

@ -512,9 +512,7 @@ int LevelMesh::CreateLinePortal(FLevel& doomMap, const IntLineDef& srcLine, cons
int LevelMesh::CheckAndMakePortal(FLevel& doomMap, MapSubsectorEx* sub, IntSector* sector, int typeIndex, int plane)
{
const auto& lines = doomMap.GetSectorFromSubSector(sub)->lines;
for (const auto& line : lines)
for (const auto line : sector->portals)
{
if (line->special == Sector_SetPortal && line->args[0] && line->args[2] == plane && !line->args[3] && sector->HasTag(line->args[0]))
{