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! + } + } }