fixed issue when two floor's outlines overlap

This commit is contained in:
2017-06-08 12:49:57 +02:00
parent 8ed4305d2a
commit 3a92199777

View File

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