diff --git a/d3xp/Entity.cpp b/d3xp/Entity.cpp index ec636a6..c641fde 100644 --- a/d3xp/Entity.cpp +++ b/d3xp/Entity.cpp @@ -4171,6 +4171,14 @@ idEntity::Event_StartSoundShader ================ */ void idEntity::Event_StartSoundShader( const char *soundName, int channel ) { + // DG: at least some map scripts in d3xp seem to use $ent.startSoundShader( "", SND_CHANNEL_whatever ); + // to stop a playing sound. special-casing this to avoid playing beep sound (if s_playDefaultSound 1) + if ( soundName == NULL || soundName[0] == '\0' ) { + StopSound( (s_channelType)channel, false ); + idThread::ReturnFloat( 0.0f ); + return; + } + int length; StartSoundShader( declManager->FindSound( soundName ), (s_channelType)channel, 0, false, &length ); diff --git a/game/Entity.cpp b/game/Entity.cpp index 34645e3..ad16f79 100644 --- a/game/Entity.cpp +++ b/game/Entity.cpp @@ -4525,6 +4525,14 @@ idEntity::Event_StartSoundShader ================ */ void idEntity::Event_StartSoundShader( const char *soundName, int channel ) { + // DG: at least some map scripts in d3xp seem to use $ent.startSoundShader( "", SND_CHANNEL_whatever ); + // to stop a playing sound. special-casing this to avoid playing beep sound (if s_playDefaultSound 1) + if ( soundName == NULL || soundName[0] == '\0' ) { + StopSound( (s_channelType)channel, false ); + idThread::ReturnFloat( 0.0f ); + return; + } + int length; StartSoundShader( declManager->FindSound( soundName ), (s_channelType)channel, 0, false, &length );