aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_sfx_pain.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_pain.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_pain.c')
-rw-r--r--src/ft_sfx_pain.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ft_sfx_pain.c b/src/ft_sfx_pain.c
index cb68108..68340c5 100644
--- a/src/ft_sfx_pain.c
+++ b/src/ft_sfx_pain.c
@@ -31,9 +31,12 @@ void
pthread_mutex_lock(&sfx->pain_mutex);
ref = (ref > 201) ? (0) : (ref + 1);
if (ref % 3)
- system(sfx->pain_one);
- else
- system(sfx->pain_two);
+ {
+ if (system(sfx->pain_one))
+ pthread_exit(NULL);
+ }
+ else if (system(sfx->pain_two))
+ pthread_exit(NULL);
}
return (NULL);
}