aboutsummaryrefslogtreecommitdiff
path: root/map.c
diff options
context:
space:
mode:
authorKirill Petrashin <kirill8201@yandex.ru>2026-04-15 16:59:06 +0300
committerKirill Petrashin <kirill8201@yandex.ru>2026-04-15 16:59:06 +0300
commitae41c1ba2ff803ec2e86d97883dddfd79d800103 (patch)
treee817fe247f700b63fe4ee22c75597fecdbfb5819 /map.c
parent236eee73566c62e601db674c053c33aa3f41b31b (diff)
downloadastar-ae41c1ba2ff803ec2e86d97883dddfd79d800103.tar.xz
Disallow drawing walls on start/end
Diffstat (limited to 'map.c')
-rw-r--r--map.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/map.c b/map.c
index a4974ac..143329c 100644
--- a/map.c
+++ b/map.c
@@ -661,7 +661,7 @@ void map_editor(Map *map, size_t *width, size_t *height, Position *start, Positi
if (m1down) {
size_t row = event.y - map_offset_y,
col = (event.x - map_offset_x) / 2;
- if (row < *height && col < *width) {
+ if (!((row == start->y && col == start->x) || (row == goal->y && col == goal->x)) && row < *height && col < *width) {
(*map)[row][col] = cur;
path_free(path, *height);
if (should_pathfind) {