diff --git a/source/games/sw/src/copysect.cpp b/source/games/sw/src/copysect.cpp index 2b49ece3f..6e92e5e3e 100644 --- a/source/games/sw/src/copysect.cpp +++ b/source/games/sw/src/copysect.cpp @@ -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. + } } } } diff --git a/source/games/sw/src/rooms.cpp b/source/games/sw/src/rooms.cpp index 9f614a576..d41b205b6 100644 --- a/source/games/sw/src/rooms.cpp +++ b/source/games/sw/src/rooms.cpp @@ -1029,8 +1029,13 @@ void CollectPortals() TArray ceilingportals; FixedBitArray 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++) {