summaryrefslogtreecommitdiff
path: root/src/audio.c
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik@amftech.nl>2024-01-07 14:01:37 +0100
committerAldrik Ramaekers <aldrik@amftech.nl>2024-01-07 14:01:37 +0100
commit843440d1e382f909d066c82d2269df67251b35f9 (patch)
treef462ce23f15cf204b4e066d61c6ebab3487b9020 /src/audio.c
parent7cc854e55d7312c8ddcad42935271ebd9d5751a2 (diff)
player damage indicator and health regen
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);