diff options
Diffstat (limited to 'src/ft_check_map_line.c')
-rw-r--r-- | src/ft_check_map_line.c | 24 |
1 files changed, 13 insertions, 11 deletions
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 <stdint.h> 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); } |