aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_select_get.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-04 17:31:04 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-04 17:31:04 +0200
commit07ce2cc784a0d420fbc807244847b55389427f6c (patch)
tree9ccd0f73be06633204d80f92c35f191cb9bbd1ff /src/ft_select_get.c
parentMerge branch 'adventures' into bad_boy_select (diff)
download42-cub3d-07ce2cc784a0d420fbc807244847b55389427f6c.tar.gz
42-cub3d-07ce2cc784a0d420fbc807244847b55389427f6c.tar.bz2
42-cub3d-07ce2cc784a0d420fbc807244847b55389427f6c.tar.xz
42-cub3d-07ce2cc784a0d420fbc807244847b55389427f6c.tar.zst
42-cub3d-07ce2cc784a0d420fbc807244847b55389427f6c.zip
Selectable enemy
Diffstat (limited to '')
-rw-r--r--src/ft_select_get.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ft_select_get.c b/src/ft_select_get.c
index 0edc4f2..8c1df38 100644
--- a/src/ft_select_get.c
+++ b/src/ft_select_get.c
@@ -71,12 +71,14 @@ static int8_t
ret = 0;
while (ft_strncmp(words[0], clist->ref[ret], 3) && clist->ref[ret][0])
ret++;
- if (ret == 21)
+ if (ret == 22)
ret = FT_PARSE_END_RET;
ret = ft_check_exists(ret, clist);
ret = ft_check_exists_two(ret, clist);
if (ret > 13 && ret < 21)
ret = 5;
+ if (ret == 21)
+ clist->mlist.enemy = 2;
return (ret);
}
@@ -90,7 +92,7 @@ int8_t
ft_free_words(words);
return (FT_PARSE_END_RET);
}
- if (id < 0 || clist->get_ptr[id](words, clist) < 0)
+ if (id < 0 || (id != 21 && clist->get_ptr[id](words, clist) < 0))
{
ft_free_words(words);
return ((id < 0) ? (-2) : (-1));