From 8a02f071c74c8b2de0f6ffe6b115932b9bdff448 Mon Sep 17 00:00:00 2001 From: EntranceJew Date: Sun, 28 Jan 2024 23:46:37 -0600 Subject: [PATCH] make volume do something if someone's voicevolume is fucked up --- gamemodes/terrortown/gamemode/client/cl_voice.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gamemodes/terrortown/gamemode/client/cl_voice.lua b/gamemodes/terrortown/gamemode/client/cl_voice.lua index eb2225b5e0..ab9ecef80d 100644 --- a/gamemodes/terrortown/gamemode/client/cl_voice.lua +++ b/gamemodes/terrortown/gamemode/client/cl_voice.lua @@ -496,6 +496,12 @@ function VOICE.UpdatePlayerVoiceVolume(ply) out_vol = func( vol ) end + -- if the database fails for strange people then blast their ears out and save it + if out_vol ~= 0 and not out_vol then + out_vol = 1 + VOICE.SetPreferredPlayerVoiceVolume(ply, out_vol) + end + ply:SetVoiceVolumeScale( out_vol ) return out_vol, mute