From 8ab35ec5207b1df8fc58b11413f4151adb58bd7a Mon Sep 17 00:00:00 2001 From: helixhorned Date: Thu, 28 Nov 2013 21:18:04 +0000 Subject: [PATCH] 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 --- polymer/eduke32/source/player.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index 0f150e4cd..78b3f823d 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -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