From 3a921997773c0a35a9bdf8d6eb03804f6115f7a5 Mon Sep 17 00:00:00 2001 From: FrankE Date: Thu, 8 Jun 2017 12:49:57 +0200 Subject: [PATCH] fixed issue when two floor's outlines overlap --- grid/factory/v2/GridFactory.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/grid/factory/v2/GridFactory.h b/grid/factory/v2/GridFactory.h index 8d576d1..9ebd0c0 100755 --- a/grid/factory/v2/GridFactory.h +++ b/grid/factory/v2/GridFactory.h @@ -338,8 +338,15 @@ public: // does the grid contain the potential neighbor? const T* n2 = grid.getNodePtrFor(p); if (n2 != nullptr) { + if (isBlocked(floor, n1, *n2)) {continue;} // is there a (e.g. small) obstacle between the two? - grid.connectUniDir(n1, *n2); // UNI-dir connection as EACH node is processed! + + // NOTE + // if you have two floors at the >same< height, and their outlines overlap, this one is needed! + if (!n1.hasNeighbor(n2->getIdx())) { + grid.connectUniDir(n1, *n2); // UNI-dir connection as EACH node is processed! + } + } }