engine: client: fix sounds being paused in menu and then blasted all at the same time in multiplayer
This commit is contained in:
parent
433e7de686
commit
da578f47f1
2 changed files with 8 additions and 1 deletions
|
@ -70,6 +70,12 @@ float S_GetMasterVolume( void )
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( s_listener.inmenu && !ui_renderworld.value && !Host_IsLocalGame( ))
|
||||||
|
{
|
||||||
|
// mute sounds in menu when it's not transparent and we're in multiplayer
|
||||||
|
return 0.0f;
|
||||||
|
}
|
||||||
|
|
||||||
if( !s_listener.inmenu && soundfade.percent != 0 )
|
if( !s_listener.inmenu && soundfade.percent != 0 )
|
||||||
{
|
{
|
||||||
scale = bound( 0.0f, soundfade.percent / 100.0f, 1.0f );
|
scale = bound( 0.0f, soundfade.percent / 100.0f, 1.0f );
|
||||||
|
|
|
@ -523,6 +523,7 @@ static void MIX_MixChannelsToPaintbuffer( int endtime, int rate, int outputRate
|
||||||
wavdata_t *pSource;
|
wavdata_t *pSource;
|
||||||
int i, sampleCount;
|
int i, sampleCount;
|
||||||
qboolean bZeroVolume;
|
qboolean bZeroVolume;
|
||||||
|
qboolean local = Host_IsLocalGame();
|
||||||
|
|
||||||
// mix each channel into paintbuffer
|
// mix each channel into paintbuffer
|
||||||
ch = channels;
|
ch = channels;
|
||||||
|
@ -549,7 +550,7 @@ static void MIX_MixChannelsToPaintbuffer( int endtime, int rate, int outputRate
|
||||||
{
|
{
|
||||||
// play, playvol
|
// play, playvol
|
||||||
}
|
}
|
||||||
else if(( s_listener.inmenu || s_listener.paused ) && !ch->localsound )
|
else if(( s_listener.inmenu || s_listener.paused ) && !ch->localsound && local )
|
||||||
{
|
{
|
||||||
// play only local sounds, keep pause for other
|
// play only local sounds, keep pause for other
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Reference in a new issue