summaryrefslogtreecommitdiff
path: root/src/bullets.c
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik@amftech.nl>2023-10-28 12:34:52 +0200
committerAldrik Ramaekers <aldrik@amftech.nl>2023-10-28 12:34:52 +0200
commit5de0682c37fc8e9713bb566a637f19a3795abc4a (patch)
tree3269724b9027205faaa5792262ced3b4f3f064f7 /src/bullets.c
parent06d520eb39b2448ee08dce9010651a423115c798 (diff)
prep for synched audio
Diffstat (limited to 'src/bullets.c')
-rw-r--r--src/bullets.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bullets.c b/src/bullets.c
index d1c8d97..f5d5198 100644
--- a/src/bullets.c
+++ b/src/bullets.c
@@ -21,14 +21,14 @@ void shoot(platform_window* window, u32 id, float dirx, float diry) {
if (bullets_to_shoot > p->ammo_in_mag) bullets_to_shoot = p->ammo_in_mag;
p->ammo_in_mag -= bullets_to_shoot;
if (p->ammo_in_mag == 0) {
- play_positioned_sound(CHANNEL_SHOOTING, wav_reload_mp5, (vec3f){.x = p->playerx, .y = p->playery, .z = p->height}, 10);
+ add_audio_event_to_queue(EVENT_RELOAD, p->id, (vec3f){.x = p->playerx, .y = p->playery, .z = p->height});
p->interact_state = INTERACT_RELOADING;
p->sec_since_interact_state_change = 0;
return;
}
- play_positioned_sound(CHANNEL_SHOOTING, wav_shoot_mp5, (vec3f){.x = p->playerx, .y = p->playery, .z = p->height}, 20);
-
+ add_audio_event_to_queue(EVENT_SHOOT, p->id, (vec3f){.x = p->playerx, .y = p->playery, .z = p->height});
+
for (int i = 0; i < bullets_to_shoot; i++)
{
map_info info = get_map_info(window);