add: replace player spawn char to '0' and store spawn_direction
This commit is contained in:
parent
b323b98dc0
commit
c9d9faa45c
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user