aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_get_nlvl_pos.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_get_nlvl_pos.c')
-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++;
+ }
+}