linije

Unnamed repository; edit this file 'description' to name the repository.
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

чување f1923697e447f419b9bf497956ae68f1ef852390
родитељ c600bfd13055ee47eb50a3f7c114ce1d6dec5b4d
Аутор: Страхиња Радић <sr@strahinja.org>
Датум:   Tue, 12 Aug 2025 19:16:22 +0200

Deselect the ball if there is no path to destination

Diffstat:
Mlinije.c | 7++++++-
измењених датотека: 1, додавања: 6(+), брисања: 1(-)

diff --git a/linije.c b/linije.c @@ -761,7 +761,12 @@ handle_click(struct State* state) state->path_end->coords.y); state->path_end->ending = 1; - find_shortest_path(state->path_start, NULL, 0); + if (!find_shortest_path(state->path_start, NULL, 0)) + { + reset_path(state->grid); + goto handle_click_reset; + } + mark_path(state->path_end); printf("M =\n"); print_matrix(state->grid);