diff --git a/src/main.c b/src/main.c index c053bd9..3199ab7 100644 --- a/src/main.c +++ b/src/main.c @@ -6,7 +6,7 @@ /* By: kcolin +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/07/17 14:14:30 by kcolin #+# #+# */ -/* Updated: 2025/09/16 16:07:09 by tchampio ### ########.fr */ +/* Updated: 2025/09/17 12:51:34 by tchampio ### ########.fr */ /* */ /* ************************************************************************** */ @@ -50,6 +50,11 @@ void handle_shooting(t_cub3d_data *data) data->keypresses.is_space_pressed = false; if (data->player.weapon.clip <= 0) return ; + if (data->player.weapon.is_auto) + { + if (get_milliseconds() - data->last_since_shoot < 50000) + return ; + } data->player.weapon.is_shooting = true; data->last_since_shoot = get_milliseconds(); data->player.weapon.clip--;