From 73fcdbf3eec3e085ac4dcc313eb2f3811aef5dbd Mon Sep 17 00:00:00 2001 From: Steve Date: Tue, 16 May 2017 19:07:51 +0100 Subject: [PATCH] Only use Mix_SetPosition if app.directionAudio is set. --- src/system/sound.c | 2 +- src/system/sound.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/system/sound.c b/src/system/sound.c index 313983e..08b5235 100644 --- a/src/system/sound.c +++ b/src/system/sound.c @@ -98,7 +98,7 @@ void playBattleSound(int id, int x, int y) vol /= MAX_BATTLE_SOUND_DISTANCE; vol *= distance; - if (distance >= MIN_BATTLE_SOUND_DISTANCE) + if (app.directionalAudio && distance >= MIN_BATTLE_SOUND_DISTANCE) { bearing = 360 - getAngle(x, y, lastPlayerX, lastPlayerY); Mix_SetPosition(channel, (Sint16)bearing, (Uint8)distance); diff --git a/src/system/sound.h b/src/system/sound.h index 9e6f6c6..e49701c 100644 --- a/src/system/sound.h +++ b/src/system/sound.h @@ -29,4 +29,5 @@ extern int getDistance(int x1, int y1, int x2, int y2); extern float getAngle(int x1, int y1, int x2, int y2); extern char *getFileLocation(char *filename); +extern App app; extern Entity *player;