feat: Made payable doors

This commit is contained in:
Theo Champion 2025-10-01 14:13:08 +02:00
parent 13b1f7a88c
commit 351e4bb679
7 changed files with 67 additions and 8 deletions

View file

@ -6,7 +6,7 @@
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/07/31 13:17:39 by kcolin #+# #+# */
/* Updated: 2025/10/01 13:36:58 by tchampio ### ########.fr */
/* Updated: 2025/10/01 14:12:44 by tchampio ### ########.fr */
/* */
/* ************************************************************************** */
@ -66,7 +66,7 @@ static int get_color(t_cub3d_data *data, t_ray *ray, int tex_y)
if (ft_strchr("234567", data->map->map[ray->map_y][ray->map_x]))
return (my_mlx_pixel_get(get_right_barricade(data,
data->map->map[ray->map_y][ray->map_x]), tex_x, tex_y));
if (data->map->map[ray->map_y][ray->map_x] == 'd')
if (data->map->map[ray->map_y][ray->map_x] == 'd' || data->map->map[ray->map_y][ray->map_x] == 'P')
return (my_mlx_pixel_get(data->door_texture, tex_x, tex_y));
if (dir == NORTH)
texture = data->no_texture;