- fixed: P_CollectConnectedGroups should abort if it tries to collect the same portal group more than once, because this would indicate an infinite loop.

This commit is contained in:
Christoph Oelckers 2017-05-14 12:24:52 +02:00
parent 1767dd6a42
commit 0f80b7dcb6

View file

@ -1246,6 +1246,7 @@ bool P_CollectConnectedGroups(int startgroup, const DVector3 &position, double u
{ {
int othergroup = wsec->GetOppositePortalGroup(sector_t::ceiling); int othergroup = wsec->GetOppositePortalGroup(sector_t::ceiling);
DVector2 pos = Displacements.getOffset(startgroup, othergroup) + position; DVector2 pos = Displacements.getOffset(startgroup, othergroup) + position;
if (processMask.getBit(othergroup)) break;
processMask.setBit(othergroup); processMask.setBit(othergroup);
out.Add(othergroup | FPortalGroupArray::UPPER); out.Add(othergroup | FPortalGroupArray::UPPER);
wsec = P_PointInSector(pos); // get upper sector at the exact spot we want to check and repeat 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); int othergroup = wsec->GetOppositePortalGroup(sector_t::floor);
DVector2 pos = Displacements.getOffset(startgroup, othergroup) + position; DVector2 pos = Displacements.getOffset(startgroup, othergroup) + position;
if (processMask.getBit(othergroup)) break;
processMask.setBit(othergroup); processMask.setBit(othergroup);
out.Add(othergroup | FPortalGroupArray::LOWER); out.Add(othergroup | FPortalGroupArray::LOWER);
wsec = P_PointInSector(pos); // get lower sector at the exact spot we want to check and repeat wsec = P_PointInSector(pos); // get lower sector at the exact spot we want to check and repeat