From c9d9faa45cfe8394217727638aa41e4a902bf188 Mon Sep 17 00:00:00 2001 From: Camille Chauvet Date: Thu, 4 May 2023 11:58:30 +0000 Subject: [PATCH] add: replace player spawn char to '0' and store spawn_direction --- map/map.h | 1 + map/parsing.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/map/map.h b/map/map.h index 307435c..bed3d5f 100644 --- a/map/map.h +++ b/map/map.h @@ -12,6 +12,7 @@ typedef struct s_map long long color_top; long long spawn_x; long long spawn_y; + char direction; } t_map; #endif diff --git a/map/parsing.c b/map/parsing.c index a6d847a..fdea169 100644 --- a/map/parsing.c +++ b/map/parsing.c @@ -20,6 +20,7 @@ static ssize_t get_nb_line(const char *path) close(fd); return (i); } + static char **read_map(const char *path) { int fd; @@ -82,5 +83,7 @@ t_map *map_parsing(const char *path) return (NULL); } map->map = body; + map->direction = map->map[map->spawn_y][map->spawn_x]; + map->map[map->spawn_y][map->spawn_x] = '0'; return (map); }