mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
Make helicopter sound respect sound effect volume setting
Helicopter sound would play upon heli insertion even if sound effects volume was set to 0 in options.
This commit is contained in:
@@ -481,7 +481,7 @@ void HandleHeliDrop( BOOLEAN fPlayer )
|
|||||||
{
|
{
|
||||||
UINT8 ubScriptCode;
|
UINT8 ubScriptCode;
|
||||||
UINT32 uiClock;
|
UINT32 uiClock;
|
||||||
INT32 iVol;
|
static INT32 iVol = 0;
|
||||||
INT32 cnt;
|
INT32 cnt;
|
||||||
ANITILE_PARAMS AniParams;
|
ANITILE_PARAMS AniParams;
|
||||||
|
|
||||||
@@ -618,11 +618,15 @@ void HandleHeliDrop( BOOLEAN fPlayer )
|
|||||||
{
|
{
|
||||||
if( uiSoundSample!=NO_SAMPLE )
|
if( uiSoundSample!=NO_SAMPLE )
|
||||||
{
|
{
|
||||||
iVol=SoundGetVolume( uiSoundSample );
|
iVol = __min(HIGHVOLUME, iVol + 5);
|
||||||
iVol=__min( HIGHVOLUME, iVol+5);
|
if ( GetSoundEffectsVolume() != 0)
|
||||||
SoundSetVolume(uiSoundSample, iVol);
|
{
|
||||||
if(iVol==HIGHVOLUME)
|
SoundSetVolume(uiSoundSample, iVol);
|
||||||
|
}
|
||||||
|
if (iVol == HIGHVOLUME)
|
||||||
|
{
|
||||||
fFadingHeliIn=FALSE;
|
fFadingHeliIn=FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -633,11 +637,11 @@ void HandleHeliDrop( BOOLEAN fPlayer )
|
|||||||
{
|
{
|
||||||
if( uiSoundSample!=NO_SAMPLE )
|
if( uiSoundSample!=NO_SAMPLE )
|
||||||
{
|
{
|
||||||
iVol=SoundGetVolume(uiSoundSample);
|
|
||||||
|
|
||||||
iVol=__max( 0, iVol-5);
|
iVol=__max( 0, iVol-5);
|
||||||
|
if (GetSoundEffectsVolume() != 0)
|
||||||
SoundSetVolume(uiSoundSample, iVol);
|
{
|
||||||
|
SoundSetVolume(uiSoundSample, iVol);
|
||||||
|
}
|
||||||
if(iVol==0)
|
if(iVol==0)
|
||||||
{
|
{
|
||||||
// Stop sound
|
// Stop sound
|
||||||
|
|||||||
Reference in New Issue
Block a user