engine: client: mute music if not in focus
This commit is contained in:
parent
260edc2a08
commit
03c8ea14cc
1 changed files with 6 additions and 0 deletions
|
@ -57,6 +57,12 @@ float S_GetMusicVolume( void )
|
||||||
{
|
{
|
||||||
float scale = 1.0f;
|
float scale = 1.0f;
|
||||||
|
|
||||||
|
if( host.status == HOST_NOFOCUS && snd_mute_losefocus.value != 0.0f )
|
||||||
|
{
|
||||||
|
// we return zero volume to keep sounds running
|
||||||
|
return 0.0f;
|
||||||
|
}
|
||||||
|
|
||||||
if( !s_listener.inmenu && musicfade.percent != 0 )
|
if( !s_listener.inmenu && musicfade.percent != 0 )
|
||||||
{
|
{
|
||||||
scale = bound( 0.0f, musicfade.percent / 100.0f, 1.0f );
|
scale = bound( 0.0f, musicfade.percent / 100.0f, 1.0f );
|
||||||
|
|
Loading…
Add table
Reference in a new issue