aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_key_events.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ft_key_events.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ft_key_events.c b/src/ft_key_events.c
index edacc42..52ef477 100644
--- a/src/ft_key_events.c
+++ b/src/ft_key_events.c
@@ -10,7 +10,6 @@
/* */
/* ************************************************************************** */
-#include <libft.h>
#include <cub3d.h>
#include <stdlib.h>
#include <stdint.h>
@@ -38,6 +37,12 @@ int
return (ft_f1_key(clist));
else if (keycode == FT_SPC_KEY && clist->plist.handles_weapon > -1)
return (ft_space_key(clist));
+ else if (keycode == FT_ONE_KEY && clist->plist.fire == 0
+ && clist->plist.has_weapon[0] == 1 && clist->plist.handles_weapon != 0)
+ return (ft_switch_weap_one(clist));
+ else if (keycode == FT_TWO_KEY && clist->plist.fire == 0
+ && clist->plist.has_weapon[1] == 1 && clist->plist.handles_weapon != 2)
+ return (ft_switch_weap_two(clist));
ft_insert_key(keycode, clist);
return (0);
}