summary refs log tree commit diff
path: root/src/GameLoop.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/GameLoop.cpp')
-rw-r--r--src/GameLoop.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/GameLoop.cpp b/src/GameLoop.cpp
index b3810c6..e89eb2e 100644
--- a/src/GameLoop.cpp
+++ b/src/GameLoop.cpp
@@ -20,6 +20,7 @@
 // along with Black Shades.  If not, see <https://www.gnu.org/licenses/>.
 
 #include "Game.h"
+#include "misc.h"
 
 extern float multiplier;
 extern int thirdperson;
@@ -95,11 +96,9 @@ void handleKey(Game* game, int key, int action, int mods)
 				                        person.averageloc) > 200)
 					continue;
 
-				auto soundsrc = (player.playercoords
-					- camera.position) / soundscalefactor;
-				float gLoc[] {soundsrc.x, soundsrc.y, soundsrc.z};
-				alSourcefv(gSourceID[clicksound], AL_POSITION, gLoc);
-				alSourcePlay(gSourceID[clicksound]);
+				auto soundpos = player.playercoords - camera.position;
+				playSound(gSourceID[clicksound],
+					soundpos.x, soundpos.y, soundpos.z);
 
 				auto tmp_gun = player.whichgun;
 				player.whichgun = person.whichgun;