summaryrefslogtreecommitdiff
path: root/src/audio.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio.c')
-rw-r--r--src/audio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/audio.c b/src/audio.c
index fa405d1..43a403d 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -153,6 +153,8 @@ void play_music(Mix_Music* music) {
}
void play_positioned_sound(int channel, Mix_Chunk* wav, vec3f pos, float max_audible_dist) {
+ player* p = get_player_by_id(player_id);
+ if (!p) return;
// calculate volume
int tiles_between_throwable_and_player = distance_between_3f((vec3f){.x = p->playerx, .y = p->playery, .z = p->height}, pos);
@@ -160,8 +162,6 @@ void play_positioned_sound(int channel, Mix_Chunk* wav, vec3f pos, float max_aud
if (volume > 1.0f) volume = 1.0f;
if (volume < 0.0f) volume = 0.0f;
- //player* p = get_player_by_id(player_id);
- //if (!p) return;
// calculate angle
/*
float dirx = (throwables[i].position.x - p->playerx);