Fixed -nosound crashing the game upon calling StartSound
This commit is contained in:
parent
a28de0cfa2
commit
1e46c5f669
1 changed files with 10 additions and 19 deletions
|
@ -488,12 +488,14 @@ extern qboolean inwat; // leilei - for underwater sounds
|
|||
extern cvar_t *temp2;
|
||||
|
||||
float leicho;
|
||||
float leivol;
|
||||
int leitap;
|
||||
int leiverb;
|
||||
int leitap;
|
||||
int leiverb;
|
||||
|
||||
void S_StartSoundForReal(int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation)
|
||||
void S_StartSound(int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation)
|
||||
{
|
||||
if(!snd_initialized)
|
||||
return;
|
||||
|
||||
channel_t *target_chan, *check;
|
||||
sfxcache_t *sc;
|
||||
int vol;
|
||||
|
@ -548,7 +550,7 @@ void S_StartSoundForReal(int entnum, int entchannel, sfx_t *sfx, vec3_t origin,
|
|||
|
||||
|
||||
itch = (float)s_pitchin->value; // leilei - get pitch for speed here
|
||||
vol = fvol*255 * leivol;
|
||||
vol = fvol*255;
|
||||
|
||||
// leilei - CONTENT HACK - don't do random pitches on doors/platforms/ambients
|
||||
if (!strncmp(sfx->name,"ambien",6) || !strncmp(sfx->name,"door",4) || !strncmp(sfx->name,"plat",4))
|
||||
|
@ -649,20 +651,6 @@ void S_StartSoundForReal(int entnum, int entchannel, sfx_t *sfx, vec3_t origin,
|
|||
// Con_Printf("loopstart %i\n", sc->loopstart);
|
||||
}
|
||||
|
||||
void S_StartSound(int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation)
|
||||
{
|
||||
int ah, sh;
|
||||
/*
|
||||
for (ah=1; ah<4; ah++){
|
||||
leivol = fvol / (ah * 0.5);
|
||||
leiverb = ah * temp2->value;
|
||||
S_StartSoundForReal(entnum, entchannel, sfx, origin, fvol, attenuation);
|
||||
}*/
|
||||
leivol = 1;
|
||||
S_StartSoundForReal(entnum, entchannel, sfx, origin, fvol, attenuation);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// =======================================================================
|
||||
// Start a custom sound effect
|
||||
|
@ -670,6 +658,9 @@ void S_StartSound(int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float f
|
|||
|
||||
void S_StartSound2(int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation, int pitch)
|
||||
{
|
||||
if(!snd_initialized)
|
||||
return;
|
||||
|
||||
channel_t *target_chan, *check;
|
||||
sfxcache_t *sc;
|
||||
int vol;
|
||||
|
|
Loading…
Reference in a new issue