From 9ba0e7b783cfea623ff472f6ee9316c1b52d0cd7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 4 Jan 2019 00:28:51 +0100 Subject: [PATCH] - 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. --- src/s_advsound.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/s_advsound.cpp b/src/s_advsound.cpp index 51d9e206e2..67a3946b2f 100644 --- a/src/s_advsound.cpp +++ b/src/s_advsound.cpp @@ -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?)