From 5de0682c37fc8e9713bb566a637f19a3795abc4a Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sat, 28 Oct 2023 12:34:52 +0200 Subject: prep for synched audio --- src/game.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/game.c') diff --git a/src/game.c b/src/game.c index 06c7df4..993d82e 100644 --- a/src/game.c +++ b/src/game.c @@ -190,13 +190,19 @@ void update_server(platform_window* window) { broadcast_zombies = platform_get_time(TIME_FULL, TIME_NS) - broadcast_zombies; update_throwables_server(window); + clear_throwables(); - broadcast_stamp = platform_get_time(TIME_FULL, TIME_NS); broadcast_to_clients(create_protocol_user_list()); broadcast_to_clients(create_protocol_zombie_list()); broadcast_to_clients(create_protocol_bullets_list()); broadcast_to_clients(create_protocol_drop_list()); + + // play sounds locally and send them to clients. + play_sounds_in_queue(); + + clear_sounds_in_queue(); + update_timer = 0.0f; } @@ -279,7 +285,6 @@ void update_client(platform_window* window) { void update_game(platform_window* window) { clear_bullets(); - clear_throwables(); if (global_state.server) { update_server(window); -- cgit v1.2.3-70-g09d2