aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_get_nlvl_pos.c
blob: db726e120780fc98ff3af2b02d1fe01cbdedf99b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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++;
	}
}