From 21e2dbe87e9d95ceac06e34ab5d80bbe6d6d7635 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Thu, 19 Mar 2020 14:05:44 +0100 Subject: Okok --- src/ft_check_map_line.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src/ft_check_map_line.c') diff --git a/src/ft_check_map_line.c b/src/ft_check_map_line.c index 50464a9..9419ab2 100644 --- a/src/ft_check_map_line.c +++ b/src/ft_check_map_line.c @@ -16,30 +16,32 @@ #include static int8_t - ft_first_checks(char *line, size_t i, t_cub *clist) + ft_first_checks(char *line, size_t i, t_cub *cl) { if (!ft_ischarset(FT_CHRST_MAP_ENTRY, line[i])) { - ft_sprintf(clist->errmsg, FT_ERR_ILL_MAP); + ft_sprintf(cl->errmsg, FT_ERR_ILL_MAP); return (-1); } if (ft_ischarset(FT_CHRST_SPAWN, line[i])) - clist->mlist.isspawn += 1; - if (clist->mlist.isspawn > 1) + cl->mlist.isspawn += 1; + if (cl->mlist.isspawn > 1) { - ft_sprintf(clist->errmsg, FT_ERR_MULT_SPAWN); + ft_sprintf(cl->errmsg, FT_ERR_MULT_SPAWN); return (-1); } if (line[i] == 'L') - clist->mlist.isnlvl += 1; - if (clist->mlist.isnlvl > 1) + cl->mlist.isnlvl += 1; + if (cl->mlist.isnlvl > 1) { - ft_sprintf(clist->errmsg, FT_ERR_MULT_NLVL); + ft_sprintf(cl->errmsg, FT_ERR_MULT_NLVL); return (-1); } - clist->mlist.istraps = (line[i] == 'T') ? (1) : (clist->mlist.istraps); - clist->mlist.isheals = (line[i] == '+') ? (1) : (clist->mlist.isheals); - ft_get_topsp(line[i], clist); + cl->mlist.istraps = (line[i] == 'T') ? (1) : (cl->mlist.istraps); + cl->mlist.isheals = (line[i] == '+') ? (1) : (cl->mlist.isheals); + cl->mlist.isweapon[0] = (line[i] == '!') ? (1) : (cl->mlist.isweapon[0]); + cl->mlist.isweapon[1] = (line[i] == '@') ? (1) : (cl->mlist.isweapon[1]); + ft_get_topsp(line[i], cl); return (0); } -- cgit v1.2.3