2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-22 01:45:19 +01:00

engine: client: mute music if not in focus

This commit is contained in:
Alibek Omarov 2024-06-17 20:32:04 +03:00
parent 260edc2a08
commit 03c8ea14cc

View File

@ -57,6 +57,12 @@ float S_GetMusicVolume( void )
{
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 )
{
scale = bound( 0.0f, musicfade.percent / 100.0f, 1.0f );