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); }