dev: improved how sprites are detected in maps

This commit is contained in:
Theo Champion 2025-08-18 13:07:08 +02:00
parent ef7a6c27a4
commit 5c7cc77419

View file

@ -6,7 +6,7 @@
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/07/31 13:43:05 by kcolin #+# #+# */
/* Updated: 2025/08/14 21:47:17 by tchampio ### ########.fr */
/* Updated: 2025/08/18 13:06:13 by tchampio ### ########.fr */
/* */
/* ************************************************************************** */
@ -65,8 +65,7 @@ void place_base_sprites(t_cub3d_data *data, char **map)
x = 0;
while (x < (int)ft_strlen(map[y]))
{
if (map[y][x] == 'M' || map[y][x] == 'Q'
|| map[y][x] == 'J' || map[y][x] == 'D')
if (ft_strchr("MQJD", map[y][x]))
{
if (data->sprite_counter < MAX_SPRITES)
data->sprite_list[data->sprite_counter++]