From d6fa3023b728dd5e47fca9f8a273d4d41e197e2d Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 14 Feb 2023 01:06:08 -0800 Subject: [PATCH] Do not set cvars with S_SetSfxVolume or S_SetMusicVolume Don't do this because in sdl/i_video.cpp, S_InitMusicVolume is called to unmute music when the window is refocused. Because I_StartupGraphics is called before those cvars are added and it is an error to try to set a cvar before it is added. --- src/s_sound.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/s_sound.c b/src/s_sound.c index e4aca26b3..044e03ba8 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -983,7 +983,7 @@ void S_UpdateClosedCaptions(void) void S_SetSfxVolume(INT32 volume) { - CV_SetValue(&cv_soundvolume, volume); + //CV_SetValue(&cv_soundvolume, volume); actualsfxvolume = cv_soundvolume.value * USER_VOLUME_SCALE; #ifdef HW3SOUND @@ -2424,7 +2424,7 @@ void S_SetMusicVolume(INT32 digvolume) if (digvolume < 0) digvolume = cv_digmusicvolume.value; - CV_SetValue(&cv_digmusicvolume, digvolume); + //CV_SetValue(&cv_digmusicvolume, digvolume); actualdigmusicvolume = cv_digmusicvolume.value * USER_VOLUME_SCALE; I_SetMusicVolume(digvolume); }