- SW: fixed sector transfers involving a portal for real this time.

It is not enough to just copy the properties - if this happens the entire portal needs to be reinitialized. The only way to do this is to run CollectPortals again to reset all portals in the map.
This commit is contained in:
Christoph Oelckers 2021-05-20 18:52:27 +02:00
parent b5358bc03c
commit e5236d3423
2 changed files with 9 additions and 4 deletions

View file

@ -246,10 +246,10 @@ void CopySectorMatch(short match)
dsectp->extra = ssectp->extra;
dsectp->visibility = ssectp->visibility;
dsectp->portalnum = ssectp->portalnum;
dsectp->portalflags = ssectp->portalflags;
if (ssectp->portalflags & (PORTAL_SECTOR_CEILING|PORTAL_SECTOR_FLOOR)) allPortals[ssectp->portalnum].dx = allPortals[ssectp->portalnum].dy = 0;
if (ssectp->floorpicnum == FAF_MIRROR_PIC || ssectp->ceilingpicnum == FAF_MIRROR_PIC)
{
CollectPortals(); // unavoidable. Since these portals are not static we have to reinitialize all of them.
}
}
}
}

View file

@ -1029,8 +1029,13 @@ void CollectPortals()
TArray<PortalGroup> ceilingportals;
FixedBitArray<MAXSECTORS> floordone, ceilingdone;
for (int i = 0; i < numsectors; i++)
{
sector[i].portalflags = sector[i].portalnum = 0;
}
floordone.Zero();
ceilingdone.Zero();
portalClear();
for (int i = 0; i < numsectors; i++)
{