From 63e112bf4cce52a51553145f4602b56c88df528c Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 12 May 2026 18:23:34 +0500 Subject: [PATCH] engine: client: soundlib: add more broken null files --- engine/client/soundlib/snd_wav.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/engine/client/soundlib/snd_wav.c b/engine/client/soundlib/snd_wav.c index fc3f6d59..69bb38d9 100644 --- a/engine/client/soundlib/snd_wav.c +++ b/engine/client/soundlib/snd_wav.c @@ -345,15 +345,28 @@ qboolean Sound_LoadWAV( const char *name, const byte *buffer, fs_offset_t filesi } // silence known-broken WAVs that contain stray non-zero samples masquerading as silence - if( Q_stristr( name, "null.wav" )) + if( Q_stristr( name, "null.wav" ) || Q_stristr( name, "_period.wav" ) || Q_stristr( name, "_comma.wav" )) { + static const uint32_t broken_crcs[] = + { + 0x14a36f29, // common/null.wav (HL1/Q1) + 0x005a43ab, // vox/_period.wav (HL1) + 0x7749ed15, // vox/_comma.wav (HL1) + }; uint32_t crc; + CRC32_Init( &crc ); CRC32_ProcessBuffer( &crc, buffer, filesize ); crc = CRC32_Final( crc ); - if( crc == 0x14a36f29 ) // common/null.wav (Half-Life) - memset( sound.wav, 0, sound.size ); + for( size_t i = 0; i < ARRAYSIZE( broken_crcs ); i++ ) + { + if( crc == broken_crcs[i] ) + { + memset( sound.wav, 0, sound.size ); + break; + } + } } return true;