diff options
Diffstat (limited to 'src/ft_get_nlvl_pos.c')
-rw-r--r-- | src/ft_get_nlvl_pos.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/ft_get_nlvl_pos.c b/src/ft_get_nlvl_pos.c new file mode 100644 index 0000000..db726e1 --- /dev/null +++ b/src/ft_get_nlvl_pos.c @@ -0,0 +1,38 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_get_nlvl_pos.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/28 20:56:25 by rbousset #+# #+# */ +/* Updated: 2020/02/28 20:56:26 by rbousset ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + +#include <cub3d.h> + +void + ft_get_nlvl_pos(t_map *ml) +{ + size_t x; + size_t y; + + x = 1; + y = 1; + while (ml->map[y]) + { + while (ml->map[y][x]) + { + if (ml->map[y][x] == 'L') + { + ml->nlx = x; + ml->nly = y; + return ; + } + x++; + } + x = 1; + y++; + } +} |