diff --git a/src/main.cpp b/src/main.cpp index 600dd18..e598baf 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -63,23 +63,30 @@ std::vector> vector_cellmap(HeightMap* heightmap, int interva if (candidate->x +1 == current->x && candidate->y == current->y) { current->next = candidate; candidate->previous = current; + break; } else if (candidate->x -1 == current->x && candidate->y == current->y) { current->next = candidate; candidate->previous = current; + break; } else if (candidate->y +1 == current->y && candidate->x == current->x) { current->next = candidate; candidate->previous = current; + break; } else if (candidate->y -1 == current->y && candidate->x == current->x) { current->next = candidate; candidate->previous = current; - } - else { - current->endpoint = true; + break; } } + + } + if (current->next == nullptr) + { + current->endpoint = true; + std::cout << "🤕"; } } @@ -177,7 +184,7 @@ void write_output_file(std::vector> all_points, const char *f std::vector points = all_points[j]; - Point* current = &points[0]; + Point* current = &points[50]; while (true) { //int x_raw = i%width;