- fixed: The player sound lookup would fail if a sound was only available for the last gender in the list.

This is an ancient bug, but it never registered before - only after making 'other' the default gender for nonsense input it became apparent.
This commit is contained in:
Christoph Oelckers 2019-01-04 00:28:51 +01:00
parent 845141d9af
commit 9ba0e7b783
1 changed files with 2 additions and 1 deletions

View File

@ -1757,9 +1757,10 @@ static int S_LookupPlayerSound (int classidx, int gender, FSoundID refid)
{
int g;
for (g = 0; g < GENDER_MAX && listidx == 0xffff; ++g)
for (g = 0; g < GENDER_MAX; ++g)
{
listidx = PlayerClassLookups[classidx].ListIndex[g];
if (listidx != 0xffff) break;
}
if (g == GENDER_MAX)
{ // No sounds defined at all for this class (can this happen?)