summaryrefslogtreecommitdiff
path: root/src/audio.c
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik@amftech.nl>2024-01-07 12:24:38 +0100
committerAldrik Ramaekers <aldrik@amftech.nl>2024-01-07 12:24:38 +0100
commit33f39cd8ef08db0007c9690992bad99edbaa1795 (patch)
treee1e48263aaa124ca826b4c5984e3511e56bde70f /src/audio.c
parent1f3e6604cf2df6ae11944f99f939b8b697ebd4d9 (diff)
zombie hit player
Diffstat (limited to 'src/audio.c')
-rw-r--r--src/audio.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/audio.c b/src/audio.c
index 1f88d17..4059854 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -42,6 +42,7 @@ static int get_channel_from_audio_event_type(audio_event_type event) {
return i;
}
}
+ log_info("Ran out of audio channels");
return 0;
}
@@ -120,6 +121,11 @@ static Mix_Chunk* get_sample_from_audio_event(audio_event event, u32 playerid) {
int random_screech_index = rand() % NUM_SCREECHES;
return wav_screech[random_screech_index];
}
+ case EVENT_PLAYERHURT: {
+ int random_hurt_index = rand() % NUM_PLAYER_HURT;
+ return wav_player_hurt[random_hurt_index];
+ return wav_error;
+ }
default: return wav_error;
}