summaryrefslogtreecommitdiff
path: root/src/audio.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio.c')
-rw-r--r--src/audio.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/audio.c b/src/audio.c
index e831f6b..b933f35 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -175,6 +175,10 @@ void play_positioned_sound(int channel, Mix_Chunk* wav, vec3f pos, float max_aud
*/
int c = Mix_PlayChannel(-1, wav, 0);
- if (c == -1) log_info("Audio not playable because no channels are free");
- Mix_SetPosition(c, 0, (int)(volume*255));
+ if (c == -1) {
+ log_info("Audio not playable because no channels are free");
+ }
+ else {
+ Mix_SetPosition(c, 0, (int)(volume*255));
+ }
}