mirror of
https://github.com/ZDoom/ZDRay.git
synced 2024-11-21 19:50:54 +00:00
Fix CheckAndMakePortal missing tagged sectors
This commit is contained in:
parent
e8e339c8f7
commit
b003565ad2
3 changed files with 19 additions and 3 deletions
|
@ -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; }
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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]))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue