From 8f2542e05f36a071248e49ade4d8bad654ff74f8 Mon Sep 17 00:00:00 2001 From: Yamagi Date: Mon, 4 May 2020 09:51:53 +0200 Subject: [PATCH] Limit the new order of the pending sound lists to baseq2 and the addons. The new ordering was introduced in 16ee007, fixing some problems with the wrong sound getting played when an entity triggers several sound at the same timestamp. This broke the behavior of the mods, in #558 dday was mentioned, muzzle flashe sound prevent the firing sound from getting played. Since we don't control the source of all mods, add a simple band aid fix: Use the new ordering for baseq2, xatrix and rouge. Use the old ordering for everything else. An alternative approach is being discussed in #564. --- src/client/sound/sound.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/client/sound/sound.c b/src/client/sound/sound.c index e146183e..00f6aa8d 100644 --- a/src/client/sound/sound.c +++ b/src/client/sound/sound.c @@ -722,11 +722,25 @@ S_StartSound(vec3_t origin, int entnum, int entchannel, sfx_t *sfx, } } - /* sort into the pending sound list */ - for (sort = s_pendingplays.next; - sort != &s_pendingplays && sort->begin <= ps->begin; - sort = sort->next) + cvar_t *game = Cvar_Get("game", "", CVAR_LATCH | CVAR_SERVERINFO); + + if ((strcmp(game->string, "") == 0) || + (strcmp(game->string, "rogue") == 0) || + (strcmp(game->string, "xatrix") == 0)) { + for (sort = s_pendingplays.next; + sort != &s_pendingplays && sort->begin <= ps->begin; + sort = sort->next) + { + } + } + else + { + for (sort = s_pendingplays.next; + sort != &s_pendingplays && sort->begin < ps->begin; + sort = sort->next) + { + } } ps->next = sort;