fixed issue when two floor's outlines overlap
This commit is contained in:
@@ -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!
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user