From 4e1cc264fa8ba8b4a1867f60069a77f32b6887f1 Mon Sep 17 00:00:00 2001 From: danij Date: Mon, 26 Aug 2013 05:16:07 +0100 Subject: [PATCH] World|Sector: Improved sector cluster linking wrt independent but nested hacks This iteration of the linking algorithm resolves cases such as the twin balcony bridge in requiem.wad MAP13 and the nukeage pools in av.wad MAP01 (the latter is not yet completely fixed, however). --- doomsday/client/src/world/sector.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/doomsday/client/src/world/sector.cpp b/doomsday/client/src/world/sector.cpp index 0f4e851ae5..5e809bf269 100644 --- a/doomsday/client/src/world/sector.cpp +++ b/doomsday/client/src/world/sector.cpp @@ -73,11 +73,10 @@ void Sector::Cluster::remapVisPlanes() if(otherLeaf.hasCluster()) { Cluster *otherCluster = &otherLeaf.cluster(); - if(otherCluster != this) + if(otherCluster != this && + otherCluster->_mappedVisFloor != this && + !(!_allSelfRefBoundary && otherCluster->_allSelfRefBoundary)) { - if(!_allSelfRefBoundary && otherCluster->_allSelfRefBoundary) - return; - // Remember the exterior cluster. exteriorCluster = otherCluster; } @@ -106,9 +105,11 @@ void Sector::Cluster::remapVisPlanes() } else { - // Reverse the linkage (this cluster is containted). + // This cluster is containted. Remove linkage from exterior to + // this thereby forcing it to be re-evaluated (however next time + // a different cluster will be selected from the boundary). exteriorCluster->_mappedVisFloor = - exteriorCluster->_mappedVisCeiling = exteriorCluster; + exteriorCluster->_mappedVisCeiling = 0; } }