summaryrefslogtreecommitdiff
path: root/src/audio.c
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik@amftech.nl>2023-12-24 11:55:06 +0100
committerAldrik Ramaekers <aldrik@amftech.nl>2023-12-24 11:55:06 +0100
commiteefc69b2c3816ed4c97bf976b7373175b8e7343d (patch)
treebf4b146e2667daacc7d5c838ee96c170966b306e /src/audio.c
parentff3de32a164619ee1599c4f43600872f6cf955c4 (diff)
auudio
Diffstat (limited to 'src/audio.c')
-rw-r--r--src/audio.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/audio.c b/src/audio.c
index 696b9ec..4dbcdc9 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -9,11 +9,11 @@ void add_throwable_audio_event_to_queue(audio_event_type event, throwable_type t
}
}
-void add_zombie_audio_event_to_queue(audio_event_type event, zombie_type zombie, u32 playerid, vec3f position) {
+void add_zombie_audio_event_to_queue(audio_event_type event, zombie_type zombie, vec3f position) {
for (int i = 0; i < max_audio_events; i++) {
if (audio_events[i].active) continue;
- audio_events[i] = (audio_event){.active = true, .throwable = THROWABLE_NONE, .obj = OBJECT_NONE, .zombie = zombie, .playerid = playerid, .position = position, .type = event};
+ audio_events[i] = (audio_event){.active = true, .throwable = THROWABLE_NONE, .obj = OBJECT_NONE, .zombie = zombie, .playerid = -1, .position = position, .type = event};
return;
}
}
@@ -97,6 +97,10 @@ static Mix_Chunk* get_sample_from_audio_event(audio_event event, u32 playerid) {
}
}
}
+ case EVENT_ZOMBIESCREECH: {
+ int random_screech_index = rand() % NUM_SCREECHES;
+ return wav_screech[random_screech_index];
+ }
default: return wav_error;
}