diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-03 20:26:03 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-03 20:26:03 +0100 |
commit | 3d5d770c0f43f9b4cfe59dc694f78b18803a7872 (patch) | |
tree | ae25b98e1dd04a82d9b44aea0649e4df5cd6dc45 /src/ft_parse_map.c | |
parent | Now better handling (diff) | |
download | 42-cub3d-3d5d770c0f43f9b4cfe59dc694f78b18803a7872.tar.gz 42-cub3d-3d5d770c0f43f9b4cfe59dc694f78b18803a7872.tar.bz2 42-cub3d-3d5d770c0f43f9b4cfe59dc694f78b18803a7872.tar.xz 42-cub3d-3d5d770c0f43f9b4cfe59dc694f78b18803a7872.tar.zst 42-cub3d-3d5d770c0f43f9b4cfe59dc694f78b18803a7872.zip |
Changing stuff
Diffstat (limited to 'src/ft_parse_map.c')
-rw-r--r-- | src/ft_parse_map.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/ft_parse_map.c b/src/ft_parse_map.c index e54b53c..256d131 100644 --- a/src/ft_parse_map.c +++ b/src/ft_parse_map.c @@ -61,7 +61,9 @@ static int8_t ft_memdel((void**)&line); return (ft_parse_it(fd, clist)); } - if (!ft_ischarset("RNSEWFCLM1\0", line[0]) + if (ft_ischarset("1 ", line[0])) + return ((ft_get_map_first_line(line, clist) < 0) ? (-1) : (12)); + if (!ft_ischarset("RNSEWFCLM\0", line[0]) || !(words = ft_split(line, ' '))) return (ft_error_here(FT_ERR_ILL_ENTRY, line, clist)); if ((ret = ft_select_get(words, clist)) == 12) @@ -78,6 +80,19 @@ static void ft_exit(FT_RET_NO_MAP, clist); } +static void + ft_print_map(t_map *ml) +{ + size_t i; + + i = 0; + while (ml->map[i]) + { + ft_printf("[%s]\n", ml->map[i]); + i++; + } +} + void ft_parse_map(const char *map_path, t_cub *clist) { @@ -101,6 +116,7 @@ void ft_get_nlvl_pos(&clist->mlist); ft_check_missing(clist); ft_set_minimap_scale(clist); + ft_print_map(&clist->mlist); clist->currlvl += 1; close(fd); } |