diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-07 22:26:28 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-07 22:26:28 +0100 |
commit | cfc2ab3f0c94234a98be573af394b23868166f84 (patch) | |
tree | d39ed1364e3c9ceb669decc625f4aa2c145cba8b /src | |
parent | DIVINE INTELLECT (diff) | |
download | 42-cub3d-cfc2ab3f0c94234a98be573af394b23868166f84.tar.gz 42-cub3d-cfc2ab3f0c94234a98be573af394b23868166f84.tar.bz2 42-cub3d-cfc2ab3f0c94234a98be573af394b23868166f84.tar.xz 42-cub3d-cfc2ab3f0c94234a98be573af394b23868166f84.tar.zst 42-cub3d-cfc2ab3f0c94234a98be573af394b23868166f84.zip |
Got secret door bonus
Diffstat (limited to 'src')
-rw-r--r-- | src/ft_check_map_line.c | 2 | ||||
-rw-r--r-- | src/ft_check_map_surrounds.c | 2 | ||||
-rw-r--r-- | src/ft_detect.c | 3 | ||||
-rw-r--r-- | src/ft_draw_map.c | 2 | ||||
-rw-r--r-- | src/ft_parse_map.c | 2 |
5 files changed, 5 insertions, 6 deletions
diff --git a/src/ft_check_map_line.c b/src/ft_check_map_line.c index 7b9b545..213d75c 100644 --- a/src/ft_check_map_line.c +++ b/src/ft_check_map_line.c @@ -18,7 +18,7 @@ static int8_t ft_first_checks(char *line, size_t i, t_cub *clist) { - if (!ft_ischarset("012NSEWL ", line[i])) + if (!ft_ischarset("012NSEWLD ", line[i])) { ft_sprintf(clist->errmsg, FT_ERR_ILL_MAP); return (-1); diff --git a/src/ft_check_map_surrounds.c b/src/ft_check_map_surrounds.c index 2bf228c..07c9540 100644 --- a/src/ft_check_map_surrounds.c +++ b/src/ft_check_map_surrounds.c @@ -42,7 +42,7 @@ void { while (ml->map[y][x]) { - if (ft_ischarset("02NESWL", ml->map[y][x])) + if (ft_ischarset("02NESWLD", ml->map[y][x])) { if (ft_wall_check(y, x, ml->map) < 0) ft_map_error(FT_ERR_MAP_WALLS, cl); diff --git a/src/ft_detect.c b/src/ft_detect.c index 8ab3d57..cbd8c58 100644 --- a/src/ft_detect.c +++ b/src/ft_detect.c @@ -74,8 +74,7 @@ void cl->rlist.sqy += cl->mlist.y_step; cl->rlist.side = 1; } - if (cl->mlist.map[cl->rlist.sqx][cl->rlist.sqy] == '1' || - cl->mlist.map[cl->rlist.sqx][cl->rlist.sqy] == 'L') + if (ft_ischarset("1LD", cl->mlist.map[cl->rlist.sqx][cl->rlist.sqy])) cl->rlist.hit = 1; } } diff --git a/src/ft_draw_map.c b/src/ft_draw_map.c index 2ca5f37..232891c 100644 --- a/src/ft_draw_map.c +++ b/src/ft_draw_map.c @@ -49,7 +49,7 @@ void { while (map[y][x]) { - if (map[y][x] == '1') + if (ft_ischarset("1D", map[y][x])) ft_draw_square(scale + 9 + (x * (scale)), ft_y_offset(clist) - 9 + (y * (scale)), 0x00ca5422, clist); else if (map[y][x] == '2') diff --git a/src/ft_parse_map.c b/src/ft_parse_map.c index 36d1ec5..38ce686 100644 --- a/src/ft_parse_map.c +++ b/src/ft_parse_map.c @@ -65,7 +65,7 @@ static int8_t } if (ft_ischarset("1 ", line[0])) return ((ft_get_map_first_line(line, clist) < 0) ? (-1) : (12)); - if (!ft_ischarset("RNSEWFCLM", line[0]) + if (!ft_ischarset("RNSEWFCLMD", line[0]) || !(words = ft_split(line, ' '))) return (ft_error_here(FT_ERR_ILL_ENTRY, line, clist)); if ((ret = ft_select_get(words, clist)) == 12) |