Only use Mix_SetPosition if app.directionAudio is set.
This commit is contained in:
parent
1ade5e6c38
commit
73fcdbf3ee
|
@ -98,7 +98,7 @@ void playBattleSound(int id, int x, int y)
|
||||||
vol /= MAX_BATTLE_SOUND_DISTANCE;
|
vol /= MAX_BATTLE_SOUND_DISTANCE;
|
||||||
vol *= distance;
|
vol *= distance;
|
||||||
|
|
||||||
if (distance >= MIN_BATTLE_SOUND_DISTANCE)
|
if (app.directionalAudio && distance >= MIN_BATTLE_SOUND_DISTANCE)
|
||||||
{
|
{
|
||||||
bearing = 360 - getAngle(x, y, lastPlayerX, lastPlayerY);
|
bearing = 360 - getAngle(x, y, lastPlayerX, lastPlayerY);
|
||||||
Mix_SetPosition(channel, (Sint16)bearing, (Uint8)distance);
|
Mix_SetPosition(channel, (Sint16)bearing, (Uint8)distance);
|
||||||
|
|
|
@ -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 float getAngle(int x1, int y1, int x2, int y2);
|
||||||
extern char *getFileLocation(char *filename);
|
extern char *getFileLocation(char *filename);
|
||||||
|
|
||||||
|
extern App app;
|
||||||
extern Entity *player;
|
extern Entity *player;
|
||||||
|
|
Loading…
Reference in New Issue