Better sound fix

git-svn-id: https://svn.eduke32.com/eduke32@554 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2007-08-15 03:05:14 +00:00
parent 3fcc3771bd
commit 66538686e2
2 changed files with 7 additions and 3 deletions

View file

@ -1239,9 +1239,7 @@ static void movefx(void)
if (p == myconnectindex && ps[p].cursectnum == s->sectnum)
{
j = s->lotag+((unsigned)global_random%(s->hitag+1));
if (j < NUM_SOUNDS && sounds[j])
sound(j);
else OSD_Printf("WARNING: invalid sound #%d\n",j);
sound(j);
T5 = 26*40 + (global_random%(26*40));
}
}

View file

@ -414,6 +414,12 @@ void sound(int num)
if (VoiceToggle==0 && (soundm[num]&4)) return;
if ((soundm[num]&8) && ud.lockout) return;
if (FX_VoiceAvailable(soundpr[num]) == 0) return;
if (num > NUM_SOUNDS-1 || !sounds[num])
{
OSD_Printf("WARNING: invalid sound #%d\n",num);
return;
}
pitchs = soundps[num];
pitche = soundpe[num];