aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_parse_map.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-03 16:14:26 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-03 16:14:26 +0100
commitce43b1cd1caa539af687425f58a6999a20807878 (patch)
tree34631aef16b6eb1d5d650fe9e900916f9810215d /src/ft_parse_map.c
parentMakefile update (diff)
download42-cub3d-ce43b1cd1caa539af687425f58a6999a20807878.tar.gz
42-cub3d-ce43b1cd1caa539af687425f58a6999a20807878.tar.bz2
42-cub3d-ce43b1cd1caa539af687425f58a6999a20807878.tar.xz
42-cub3d-ce43b1cd1caa539af687425f58a6999a20807878.tar.zst
42-cub3d-ce43b1cd1caa539af687425f58a6999a20807878.zip
Going full stack is bav
Diffstat (limited to 'src/ft_parse_map.c')
-rw-r--r--src/ft_parse_map.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/ft_parse_map.c b/src/ft_parse_map.c
index 9b34087..e54b53c 100644
--- a/src/ft_parse_map.c
+++ b/src/ft_parse_map.c
@@ -25,13 +25,13 @@ static void
size_t j;
i = 0;
- ml = clist.mlist;
- while (ml.map[i])
+ ml = &clist->mlist;
+ while (ml->map[i])
i++;
j = 0;
- while (ml.map[i - 1][j])
+ while (ml->map[i - 1][j])
{
- if (ml.map[i - 1][j] != '1' && ml.map[i - 1][j] != '\0')
+ if (ml->map[i - 1][j] != '1' && ml->map[i - 1][j] != '\0')
ft_map_error(FT_ERR_MAP_L_L, clist);
j++;
}
@@ -51,7 +51,7 @@ static int8_t
char **words;
int ret;
- clist.mlist.line_chk += 1;
+ clist->mlist.line_chk += 1;
if ((ret = get_next_line(fd, &line)) < 0)
return (ft_map_error(FT_ERR_READ, clist));
if (ret == 0)
@@ -93,14 +93,14 @@ void
while (ret != 12 && ret >= 0)
ret = ft_parse_it(fd, clist);
(ret == -2) ? (ft_map_error(FT_ERR_ALR_SET, clist)) : 0;
- (ret == -1) ? (ft_map_error(clist.errmsg, clist)) : 0;
+ (ret == -1) ? (ft_map_error(clist->errmsg, clist)) : 0;
if (ft_get_map_core(fd, clist) < 0)
- ft_map_error(clist.errmsg, clist);
+ ft_map_error(clist->errmsg, clist);
ft_check_map_last_line(clist);
- ft_get_player_spawn(clist.plist, clist);
- ft_get_nlvl_pos(clist.mlist);
+ ft_get_player_spawn(&clist->plist, clist);
+ ft_get_nlvl_pos(&clist->mlist);
ft_check_missing(clist);
ft_set_minimap_scale(clist);
- clist.currlvl += 1;
+ clist->currlvl += 1;
close(fd);
}