fix: allow empty lines between texture definitions

This commit is contained in:
Khaïs COLIN 2025-07-21 12:38:28 +02:00
parent 5b9c293503
commit 40e0673425
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo

View file

@ -6,7 +6,7 @@
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/06/21 19:35:43 by tchampio #+# #+# */
/* Updated: 2025/07/17 14:46:29 by kcolin ### ########.fr */
/* Updated: 2025/07/21 12:48:50 by kcolin ### ########.fr */
/* */
/* ************************************************************************** */
@ -78,7 +78,9 @@ bool add_textures(int fd, t_mapdata *map)
set_lines = 0;
while (line && set_lines < 6)
{
if (!set_textures(line, map))
if (line[0] == '\0' || line[0] == '\n')
;
else if (!set_textures(line, map))
return (free(line), gnl_exhaust(fd), false);
else
set_lines++;