diff --git a/assets/maps/map2.cub b/assets/maps/map2.cub index 3822441..cdb1b1d 100644 --- a/assets/maps/map2.cub +++ b/assets/maps/map2.cub @@ -1,7 +1,7 @@ NO assets/textures/backRoom3.png SO assets/textures/backRoom3.png WE assets/textures/backRoom3.png -EA assets/textures/backRoom3.png +EAS assets/textures/backRoom3.png C 164,157,79 F 30,55,55 diff --git a/src/map/read_map.c b/src/map/read_map.c index 59a8a67..5aa839c 100644 --- a/src/map/read_map.c +++ b/src/map/read_map.c @@ -6,7 +6,7 @@ /* By: aortigos line && map->line[0] != '1' && map->line[0] != 32) { - if (check_color_textures(map->line)) + res = check_color_textures(map->line); + if (res == 1) { tmp = ft_strjoin(map->ture, map->line); ft_memfree(map->ture); map->ture = ft_strdup(tmp); ft_memfree(tmp); (*count)++; + } else if (res == -1) + { + ft_putstr_fd("Error: Invalid element in map\n", 2); + freetl(map->ture, map->line, map->fd); + exit(1); } ft_memfree(map->line); map->line = get_next_line(map->fd); diff --git a/src/parsing/textures.c b/src/parsing/textures.c index 7fc9c05..df4bab8 100644 --- a/src/parsing/textures.c +++ b/src/parsing/textures.c @@ -6,7 +6,7 @@ /* By: aortigos