norme: Fixed norme error

This commit is contained in:
Theo Champion 2025-09-03 16:39:12 +02:00
parent 77a532a223
commit 8d229e9c2b
2 changed files with 7 additions and 5 deletions

View file

@ -6,7 +6,7 @@
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/07/31 13:18:17 by kcolin #+# #+# */
/* Updated: 2025/08/20 16:53:53 by tchampio ### ########.fr */
/* Updated: 2025/09/01 15:56:31 by tchampio ### ########.fr */
/* */
/* ************************************************************************** */
@ -64,7 +64,8 @@ void matrix_image_put(t_cub3d_data *data, t_img_data *img, int x, int y)
j = x;
while (j - x < img->width)
{
if (j < WIDTH && my_mlx_pixel_get(img, j - x, i - y) != SPRITE_TRANPARENCY_COLOR)
if (j < WIDTH && my_mlx_pixel_get(img, j - x, i - y)
!= SPRITE_TRANPARENCY_COLOR)
matrix_set(data, j, i, my_mlx_pixel_get(img, j - x, i - y));
j++;
}

View file

@ -6,7 +6,7 @@
/* By: tchampio <tchampio@student.42lehavre.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/08/05 15:51:01 by tchampio #+# #+# */
/* Updated: 2025/08/19 19:42:43 by tchampio ### ########.fr */
/* Updated: 2025/09/01 15:55:41 by tchampio ### ########.fr */
/* */
/* ************************************************************************** */
@ -112,9 +112,10 @@ void sprite_caster(t_cub3d_data *data)
if (!data->sprite_list || !data->sprite_list[0])
return ;
sort_sprites(data->sprite_order, data->sprite_distances, data);
if (data->sprite_distances[3] <= 1.5)
if (data->sprite_distances[data->sprite_counter - 1] <= 1.5)
{
if (data->sprite_list[data->sprite_order[3]]->sprite_type == PERK)
if (data->sprite_list[data->sprite_order[data->sprite_counter - 1]]
->sprite_type == PERK)
{
if (data->keypresses.is_f_pressed)
{