Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Voice: safe guard against invalid DB volume values #1335

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions gamemodes/terrortown/gamemode/client/cl_voice.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading