aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r4p3.le-101.fr>2020-02-09 19:45:09 +0100
committerRudy Bousset <rbousset@z2r4p3.le-101.fr>2020-02-09 19:45:09 +0100
commit76e56bbe177ffcf1ecc216511792a9035cf620bf (patch)
treea3628a25e38120afb2736b4e042ce7ebde391f0d
parentme dumb (diff)
download42-cub3d-76e56bbe177ffcf1ecc216511792a9035cf620bf.tar.gz
42-cub3d-76e56bbe177ffcf1ecc216511792a9035cf620bf.tar.bz2
42-cub3d-76e56bbe177ffcf1ecc216511792a9035cf620bf.tar.xz
42-cub3d-76e56bbe177ffcf1ecc216511792a9035cf620bf.tar.zst
42-cub3d-76e56bbe177ffcf1ecc216511792a9035cf620bf.zip
Better error management
-rw-r--r--map/map_one.cub8
-rw-r--r--src/ft_parse_map.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/map/map_one.cub b/map/map_one.cub
index 2a4c17a..7b42dfe 100644
--- a/map/map_one.cub
+++ b/map/map_one.cub
@@ -1,13 +1,12 @@
-R 1200 600
+R 3000 1001
NO ./path_to_the_north_texture
SO ./path_to_the_south_texture
EA ./path_to_the_east_texture
WE ./path_to_the_west_texture
-
S ./path_to_the_sprite_texture
-F 255,255,213
+F 255,878,0
C 225,30,0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
@@ -21,6 +20,7 @@ C 225,30,0
1 1 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 0 0 0 0 0 0 1 0 0 0 1
1 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 1 0 0 1 0 0 0 1
-1 1 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 1 1 0 1 1 1 1 0 N 0 1
+1 1 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 1 1 0 1 1 1 1 N 0 0 1
1 1 1 1 0 1 1 1 1 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 0 0 0 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
diff --git a/src/ft_parse_map.c b/src/ft_parse_map.c
index 3014900..a2c3b82 100644
--- a/src/ft_parse_map.c
+++ b/src/ft_parse_map.c
@@ -34,7 +34,7 @@ static void
i = 0;
while (words[i])
i++;
- if (ft_strcmp(words[i - 1], "cub"))
+ if (ft_strncmp(words[i - 1], "cub", 3))
{
ft_dprintf(STDERR_FILENO, "Error\n");
ft_dprintf(STDERR_FILENO, "\033[31;1mMap is not a .cub\033[0m\n");