From cd813bbfbe96ad5c11f3e3de57d0f9a2fbae274c Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 13 Dec 2022 11:12:08 +0300 Subject: [PATCH] engine: server: do not apply sound precache check for sentences, as they may start with 0 index --- engine/server/sv_game.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/engine/server/sv_game.c b/engine/server/sv_game.c index ffa37f5d..46e1b271 100644 --- a/engine/server/sv_game.c +++ b/engine/server/sv_game.c @@ -2091,12 +2091,12 @@ int SV_BuildSoundMsg( sizebuf_t *msg, edict_t *ent, int chan, const char *sample // precache_sound can be used twice: cache sounds when loading // and return sound index when server is active sound_idx = SV_SoundIndex( sample ); - } - if( !sound_idx ) - { - Con_Printf( S_ERROR "SV_StartSound: %s not precached (%d)\n", sample, sound_idx ); - return 0; + if( !sound_idx ) + { + Con_Printf( S_ERROR "SV_StartSound: %s not precached (%d)\n", sample, sound_idx ); + return 0; + } } spawn = FBitSet( flags, SND_RESTORE_POSITION ) ? false : true;