forked from fte/fteqw
1
0
Fork 0

Fix possible crash when using -nosound arg.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5889 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2021-06-21 13:43:40 +00:00
parent 6ad33d4ad4
commit d15d82e1d1
3 changed files with 1 additions and 17 deletions

View File

@ -3971,7 +3971,6 @@ static void CLNQ_ParseServerData(void) //Doesn't change gamedir - use with caut
cl.sound_precache[numsounds] = S_FindName(cl.sound_name[numsounds], true, false);
Sound_CheckDownload(str);
S_TouchSound (str);
}
cls.signon = 0;

View File

@ -2488,7 +2488,7 @@ sfx_t *S_FindName (const char *name, qboolean create, qboolean syspath)
if (num_sfx == MAX_SFX)
Sys_Error ("S_FindName: out of sfx_t");
if (create)
if (create && known_sfx)
{
sfx = &known_sfx[i];
strcpy (sfx->name, name);
@ -2575,20 +2575,6 @@ void S_UntouchAll(void)
known_sfx[i].touched = false;
}
/*
==================
S_TouchSound
==================
*/
void S_TouchSound (char *name)
{
if (!sound_started)
return;
S_FindName (name, true, false);
}
/*
==================
S_PrecacheSound

View File

@ -224,7 +224,6 @@ sfx_t *Media_NextTrack(int musicchanel, float *time); //queries the track we're
sfx_t *S_FindName (const char *name, qboolean create, qboolean syspath);
sfx_t *S_PrecacheSound2 (const char *sample, qboolean syspath);
#define S_PrecacheSound(s) S_PrecacheSound2(s,false)
void S_TouchSound (char *sample);
void S_UntouchAll(void);
void S_ClearPrecache (void);
void S_BeginPrecaching (void);