aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_get_nlvl_pos.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r5p2.le-101.fr>2020-02-28 18:55:45 +0100
committerRudy Bousset <rbousset@z2r5p2.le-101.fr>2020-02-28 18:55:45 +0100
commitcbb47afbbcc9b42f3094df620bbc0ef02aa7f3d2 (patch)
tree1e0aa232748e071c10779ed7dbf641178d85664e /src/ft_get_nlvl_pos.c
parentIn progress (diff)
download42-cub3d-cbb47afbbcc9b42f3094df620bbc0ef02aa7f3d2.tar.gz
42-cub3d-cbb47afbbcc9b42f3094df620bbc0ef02aa7f3d2.tar.bz2
42-cub3d-cbb47afbbcc9b42f3094df620bbc0ef02aa7f3d2.tar.xz
42-cub3d-cbb47afbbcc9b42f3094df620bbc0ef02aa7f3d2.tar.zst
42-cub3d-cbb47afbbcc9b42f3094df620bbc0ef02aa7f3d2.zip
Parsed
Diffstat (limited to '')
-rw-r--r--src/ft_get_nlvl_pos.c26
1 files changed, 26 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..069b226
--- /dev/null
+++ b/src/ft_get_nlvl_pos.c
@@ -0,0 +1,26 @@
+#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++;
+ }
+}