From 0f80b7dcb61f18bbad8a3070123d7d78e2aea82c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 14 May 2017 12:24:52 +0200 Subject: [PATCH] - fixed: P_CollectConnectedGroups should abort if it tries to collect the same portal group more than once, because this would indicate an infinite loop. --- src/portal.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/portal.cpp b/src/portal.cpp index 0b74359a65..41158e0eef 100644 --- a/src/portal.cpp +++ b/src/portal.cpp @@ -1246,6 +1246,7 @@ bool P_CollectConnectedGroups(int startgroup, const DVector3 &position, double u { int othergroup = wsec->GetOppositePortalGroup(sector_t::ceiling); DVector2 pos = Displacements.getOffset(startgroup, othergroup) + position; + if (processMask.getBit(othergroup)) break; processMask.setBit(othergroup); out.Add(othergroup | FPortalGroupArray::UPPER); wsec = P_PointInSector(pos); // get upper sector at the exact spot we want to check and repeat @@ -1256,6 +1257,7 @@ bool P_CollectConnectedGroups(int startgroup, const DVector3 &position, double u { int othergroup = wsec->GetOppositePortalGroup(sector_t::floor); DVector2 pos = Displacements.getOffset(startgroup, othergroup) + position; + if (processMask.getBit(othergroup)) break; processMask.setBit(othergroup); out.Add(othergroup | FPortalGroupArray::LOWER); wsec = P_PointInSector(pos); // get lower sector at the exact spot we want to check and repeat