From 8868be659fbebd053a3c694097bbe9a106d51188 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 23 Oct 2020 22:53:02 +0200 Subject: [PATCH] - make snd_speech toggle work in SW. --- source/core/gamecvars.cpp | 4 ++-- source/sw/src/digi.h | 5 +++-- source/sw/src/sounds.cpp | 6 +++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/source/core/gamecvars.cpp b/source/core/gamecvars.cpp index 9fff4676f..f34ff4d10 100644 --- a/source/core/gamecvars.cpp +++ b/source/core/gamecvars.cpp @@ -112,10 +112,10 @@ CUSTOM_CVARD(Bool, snd_ambience, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_N CVARD(Bool, snd_enabled, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "enables/disables sound effects") CVARD(Bool, snd_tryformats, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "enables/disables automatic discovery of replacement sounds and music in .flac and .ogg formats") -CVARD(Bool, mus_restartonload, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "restart the music when loading a saved game with the same map or not") +CVARD(Bool, mus_restartonload, false, CVAR_ARCHIVE, "restart the music when loading a saved game with the same map or not") CVARD(Bool, mus_redbook, true, CVAR_ARCHIVE, "enables/disables redbook audio") -CUSTOM_CVARD(Int, snd_speech, 1, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "enables/disables player speech") +CUSTOM_CVARD(Int, snd_speech, 1, CVAR_ARCHIVE, "enables/disables player speech") { if (self < 0) self = 0; else if (self > 1) self = 1; diff --git a/source/sw/src/digi.h b/source/sw/src/digi.h index 0e5cb8954..fd72875ff 100644 --- a/source/sw/src/digi.h +++ b/source/sw/src/digi.h @@ -35,8 +35,9 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms // !JIM! 09/20/95 // NOTE: HIGHER priority numbers have the highest precedence in the play list. #define PRI_MAX 100 -#define PRI_PLAYERDEATH 51 -#define PRI_PLAYERVOICE 50 +#define PRI_PLAYERDEATH 52 +#define PRI_PLAYERVOICE 51 +#define PRI_PLAYERSPEECH 50 #define PRI_HI_PLAYERWEAP 49 #define PRI_LOW_PLAYERWEAP 48 #define PRI_PLAYERAMBIENT 40 diff --git a/source/sw/src/sounds.cpp b/source/sw/src/sounds.cpp index d3cd551d4..5b9ef013d 100644 --- a/source/sw/src/sounds.cpp +++ b/source/sw/src/sounds.cpp @@ -816,7 +816,11 @@ int _PlayerSound(int num, PLAYERp pp) vp = &voc[num]; // Not a player voice, bail. - if (vp->priority != PRI_PLAYERVOICE && vp->priority != PRI_PLAYERDEATH) + if (vp->priority != PRI_PLAYERVOICE && vp->priority != PRI_PLAYERDEATH && vp->priority != PRI_PLAYERSPEECH) + return 0; + + // Don't talk if not allowed to. + if (vp->priority == PRI_PLAYERSPEECH && !snd_speech) return 0; // The surfacing sound should not block other player speech.