aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_sfx_footstep.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-17 17:15:32 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-17 17:15:32 +0100
commit05ad2085ab6ce4ffb280b21ce3f321b2bd75aa9e (patch)
treec6c521c8f2ad8df4477005b8225427b7459daf32 /src/ft_sfx_footstep.c
parentMerge branch 'back-to-pthread' (diff)
download42-cub3d-05ad2085ab6ce4ffb280b21ce3f321b2bd75aa9e.tar.gz
42-cub3d-05ad2085ab6ce4ffb280b21ce3f321b2bd75aa9e.tar.bz2
42-cub3d-05ad2085ab6ce4ffb280b21ce3f321b2bd75aa9e.tar.xz
42-cub3d-05ad2085ab6ce4ffb280b21ce3f321b2bd75aa9e.tar.zst
42-cub3d-05ad2085ab6ce4ffb280b21ce3f321b2bd75aa9e.zip
fps counter is bav
Diffstat (limited to 'src/ft_sfx_footstep.c')
-rw-r--r--src/ft_sfx_footstep.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ft_sfx_footstep.c b/src/ft_sfx_footstep.c
index a2eef1d..c0c9ffe 100644
--- a/src/ft_sfx_footstep.c
+++ b/src/ft_sfx_footstep.c
@@ -31,9 +31,12 @@ void
ref = (ref > 201) ? (0) : (ref + 1);
pthread_mutex_lock(&sfx->footstep_mutex);
if (ref % 2)
- system(sfx->footstep_one);
- else
- system(sfx->footstep_two);
+ {
+ if (system(sfx->footstep_one))
+ pthread_exit(NULL);
+ }
+ else if (system(sfx->footstep_two))
+ pthread_exit(NULL);
}
return (NULL);
}