Don't assign result of A_PlaySound() to p->scream_voice if the former is >127.

Because p->scream_voice is an int8_t.
This is an unlikely situation (126 voices ought to be playing simultaneously
while starting the "scream" sound), but still...

git-svn-id: https://svn.eduke32.com/eduke32@4180 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-11-28 21:18:04 +00:00
parent b6efd5e57e
commit 8ab35ec520

View file

@ -4749,7 +4749,11 @@ void P_ProcessInput(int32_t snum)
{
p->falling_counter++;
if (p->falling_counter >= 38 && p->scream_voice <= FX_Ok)
p->scream_voice = A_PlaySound(DUKE_SCREAM,p->i);
{
int32_t voice = A_PlaySound(DUKE_SCREAM,p->i);
if (voice <= 127) // XXX: p->scream_voice is an int8_t
p->scream_voice = voice;
}
}
if ((p->pos.z+p->vel.z) >= (fz-(i<<8)) && p->cursectnum >= 0) // hit the ground