From 46ed1046b3d8e9dfbb9438552582898c3c79a9f5 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Wed, 4 Mar 2020 00:17:54 +0100 Subject: Chelou maps work, now sides check --- src/ft_parse_map.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/ft_parse_map.c') diff --git a/src/ft_parse_map.c b/src/ft_parse_map.c index 256d131..0d54c6f 100644 --- a/src/ft_parse_map.c +++ b/src/ft_parse_map.c @@ -29,9 +29,11 @@ static void while (ml->map[i]) i++; j = 0; - while (ml->map[i - 1][j]) + i -= 1; + while (ml->map[i][j]) { - if (ml->map[i - 1][j] != '1' && ml->map[i - 1][j] != '\0') + if (ml->map[i][j] != '1' && ml->map[i][j] != ' ' && + ml->map[i][j] != '\0') ft_map_error(FT_ERR_MAP_L_L, clist); j++; } @@ -112,11 +114,11 @@ void if (ft_get_map_core(fd, clist) < 0) ft_map_error(clist->errmsg, clist); ft_check_map_last_line(clist); + ft_print_map(&clist->mlist); ft_get_player_spawn(&clist->plist, clist); 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); } -- cgit v1.2.3