diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-15 02:15:01 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-15 02:15:01 +0100 |
commit | b992ca41965edf663f99bae19a95d59f2fd1ed97 (patch) | |
tree | 5a2014c5f8a5db44012bd81f5e6792170d7a55b1 /src/ft_sfx_trap.c | |
parent | I need a macOS (diff) | |
download | 42-cub3d-b992ca41965edf663f99bae19a95d59f2fd1ed97.tar.gz 42-cub3d-b992ca41965edf663f99bae19a95d59f2fd1ed97.tar.bz2 42-cub3d-b992ca41965edf663f99bae19a95d59f2fd1ed97.tar.xz 42-cub3d-b992ca41965edf663f99bae19a95d59f2fd1ed97.tar.zst 42-cub3d-b992ca41965edf663f99bae19a95d59f2fd1ed97.zip |
okok
Diffstat (limited to 'src/ft_sfx_trap.c')
-rw-r--r-- | src/ft_sfx_trap.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/src/ft_sfx_trap.c b/src/ft_sfx_trap.c index 1499ecf..4b3dcf9 100644 --- a/src/ft_sfx_trap.c +++ b/src/ft_sfx_trap.c @@ -10,40 +10,14 @@ /* */ /* ************************************************************************** */ -#include <libft.h> #include <cub3d.h> #include <unistd.h> #include <stdint.h> -static void - ft_sfx_pain(t_cub *cl) -{ - static uint8_t ref = 0; - - ref += 1; - if (ref > 201) - ref = 0; - if (ref % 2) - { - cl->sfx.pain_pid = fork(); - if (cl->sfx.pain_pid == 0) - { - if (ref % 3) - execve(*(cl->sfx.pain_one + 0), cl->sfx.pain_one, cl->envp); - else - execve(*(cl->sfx.pain_two + 0), cl->sfx.pain_two, cl->envp); - } - } -} - void ft_sfx_trap(t_cub *cl) { cl->sfx.trap_pid = fork(); if (cl->sfx.trap_pid == 0) execve(*(cl->sfx.trap + 0), cl->sfx.trap, cl->envp); - else - { - ft_sfx_pain(cl); - } } |