worked on grid creation
fixed some issues with stairs fixed/added LINT
This commit is contained in:
@@ -268,7 +268,7 @@ public:
|
||||
}
|
||||
|
||||
/** remove the connection from n1 to n2 (not the other way round!) */
|
||||
void disconnectUniDir(T& n1, T& n2) {
|
||||
void disconnectUniDir(T& n1, const T& n2) {
|
||||
for (int n = 0; n < n1._numNeighbors; ++n) {
|
||||
if (n1._neighbors[n] == n2._idx) {
|
||||
arrayRemove(n1._neighbors, n, n1._numNeighbors);
|
||||
@@ -301,12 +301,16 @@ public:
|
||||
void remove(T& node) {
|
||||
|
||||
// disconnect from all neighbors
|
||||
int cnt = 0;
|
||||
while (node._numNeighbors) {
|
||||
|
||||
// by removing one neighbor, all others are shifted to close the gap within the array
|
||||
// its therefor ok to always delete array index [0]
|
||||
disconnectBiDir(node._idx, node._neighbors[0]);
|
||||
|
||||
if (++cnt > node.MAX_NEIGHBORS) {
|
||||
Log::add(name, "WARNING! found unsolveable neighboring! " + node.asString(), true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// remove from hash-list
|
||||
|
||||
Reference in New Issue
Block a user