diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-20 14:53:08 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-20 14:53:08 +0100 |
commit | 721b95e073135ad042c50d12b7bafc888634bb28 (patch) | |
tree | 5c9c2e8e0e91091bcad134f3db6418b704124c88 /src/ft_get_map.c | |
parent | Better balance (diff) | |
download | 42-cub3d-721b95e073135ad042c50d12b7bafc888634bb28.tar.gz 42-cub3d-721b95e073135ad042c50d12b7bafc888634bb28.tar.bz2 42-cub3d-721b95e073135ad042c50d12b7bafc888634bb28.tar.xz 42-cub3d-721b95e073135ad042c50d12b7bafc888634bb28.tar.zst 42-cub3d-721b95e073135ad042c50d12b7bafc888634bb28.zip |
Multiple fixes
Diffstat (limited to 'src/ft_get_map.c')
-rw-r--r-- | src/ft_get_map.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/ft_get_map.c b/src/ft_get_map.c index 8602ce3..bbe9a7f 100644 --- a/src/ft_get_map.c +++ b/src/ft_get_map.c @@ -17,7 +17,7 @@ #include <stdint.h> static void - ft_linecpy(char *line, char *mapl, size_t start) + ft_linecpy(char *line, char *mapl, size_t start, t_cub *clist) { size_t i; size_t j; @@ -28,7 +28,12 @@ static void slen = ft_strlen(line); while (i < slen && line[i]) { - mapl[j] = line[i]; + if (line[i] == '!' && clist->plist.has_weapon[0]) + mapl[j] = '0'; + else if (line[i] == '@' && clist->plist.has_weapon[1]) + mapl[j] = '0'; + else + mapl[j] = line[i]; i++; j++; } @@ -47,7 +52,7 @@ static int8_t return (-1); } ft_linecpy(line, clist->mlist.mapl, - clist->mlist.mapl_len); + clist->mlist.mapl_len, clist); clist->mlist.mapl_len += ft_strlen(line) + 1; return (0); } |