diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index 53fd759b8..14629b1a3 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -922,6 +922,7 @@ void CL_ClearState (void) CL_AllowIndependantSendCmd(false); //model stuff could be a problem. S_StopAllSounds (true); + S_ResetFailedLoad(); Cvar_ApplyLatches(CVAR_SERVEROVERRIDE); diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index 06d26a84b..bc418d9eb 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -432,6 +432,7 @@ void CL_FinishDownload(char *filename, char *tempname) break; } } + S_ResetFailedLoad(); //okay, so this can still get a little spammy in bad places... //this'll do the magic for us Skin_FlushSkin(filename); diff --git a/engine/client/snd_dma.c b/engine/client/snd_dma.c index 709cdccd8..b00c8895f 100644 --- a/engine/client/snd_dma.c +++ b/engine/client/snd_dma.c @@ -720,6 +720,13 @@ sfx_t *S_FindName (char *name) return sfx; } +void S_ResetFailedLoad(void) +{ + int i; + for (i=0 ; i < num_sfx ; i++) + known_sfx[i].failedload = false; +} + /* ================== diff --git a/engine/client/snd_mem.c b/engine/client/snd_mem.c index f2e337557..7b738d55d 100644 --- a/engine/client/snd_mem.c +++ b/engine/client/snd_mem.c @@ -785,6 +785,9 @@ sfxcache_t *S_LoadSound (sfx_t *s) char *name = s->name; + if (s->failedload) + return NULL; //it failed to load once before, don't bother trying again. + // see if still in memory sc = Cache_Check (&s->cache); if (sc) @@ -854,6 +857,7 @@ sfxcache_t *S_LoadSound (sfx_t *s) { //FIXME: check to see if qued for download. Con_DPrintf ("Couldn't load %s\n", namebuffer); + s->failedload = true; return NULL; } @@ -866,6 +870,8 @@ sfxcache_t *S_LoadSound (sfx_t *s) return sc; } } + + s->failedload = true; return NULL; } diff --git a/engine/client/sound.h b/engine/client/sound.h index c442a1c12..a3d3b408b 100644 --- a/engine/client/sound.h +++ b/engine/client/sound.h @@ -48,6 +48,7 @@ typedef struct { typedef struct sfx_s { char name[MAX_OSPATH]; + qboolean failedload; //no more super-spammy cache_user_t cache; sfxdecode_t *decoder; } sfx_t;