From f952a77c9e54cdeae09a6dda5f5a2cbaa8350b3d Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 21 Apr 2018 06:04:39 +0000 Subject: [PATCH] Sound code tweaks git-svn-id: https://svn.eduke32.com/eduke32@6836 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/game.cpp | 3 ++- source/duke3d/src/net.cpp | 2 -- source/duke3d/src/sounds.cpp | 5 ++++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index 16fe874f1..97ef2bd4e 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -6710,7 +6710,6 @@ MAIN_LOOP_RESTART: quitevent = 0; } - timerUpdate(); Net_GetPackets(); // only allow binds to function if the player is actually in a game (not in a menu, typing, et cetera) or demo @@ -6760,6 +6759,8 @@ MAIN_LOOP_RESTART: Bmemcpy(&inputfifo[0][myconnectindex], &localInput, sizeof(input_t)); + S_Update(); + do { timerUpdate(); diff --git a/source/duke3d/src/net.cpp b/source/duke3d/src/net.cpp index 26b8f12a8..b5164cd8e 100644 --- a/source/duke3d/src/net.cpp +++ b/source/duke3d/src/net.cpp @@ -412,8 +412,6 @@ void Net_ReceiveDisconnect(ENetEvent *event) void Net_GetPackets(void) { timerUpdate(); - MUSIC_Update(); - S_Update(); G_HandleSpecialKeys(); diff --git a/source/duke3d/src/sounds.cpp b/source/duke3d/src/sounds.cpp index 7e1da561e..ede6b0e1e 100644 --- a/source/duke3d/src/sounds.cpp +++ b/source/duke3d/src/sounds.cpp @@ -915,11 +915,14 @@ void S_Update(void) do { + if (g_sounds[num].num == 0) + continue; + for (bssize_t k=0; k= MAXSPRITES || g_sounds[num].num == 0 || g_sounds[num].instances[k].voice <= FX_Ok || + if ((unsigned)i >= MAXSPRITES || g_sounds[num].instances[k].voice <= FX_Ok || !FX_SoundActive(g_sounds[num].instances[k].voice)) continue;