aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_parse_map.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ft_parse_map.c8
1 files changed, 5 insertions, 3 deletions
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);
}