From 461561d2d0895588250be5d5a13c6a0c89b4b5c2 Mon Sep 17 00:00:00 2001 From: terminx Date: Thu, 12 Apr 2018 21:04:12 +0000 Subject: [PATCH] Fix a bunch of off-by-one errors in the sound system, made apparent by a change to some related code. git-svn-id: https://svn.eduke32.com/eduke32@6834 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/sounds.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/duke3d/src/sounds.cpp b/source/duke3d/src/sounds.cpp index 7ec9e171d..7e1da561e 100644 --- a/source/duke3d/src/sounds.cpp +++ b/source/duke3d/src/sounds.cpp @@ -57,7 +57,7 @@ void S_SoundStartup(void) initprintf("%d voices, %d channels, %d-bit %d Hz\n", ud.config.NumVoices, ud.config.NumChannels, ud.config.NumBits, ud.config.MixRate); - for (bssize_t i=0; i 0) return -1; } @@ -958,7 +958,7 @@ void S_ClearSoundLocks(void) if (rts_lumplockbyte[i] >= 200) rts_lumplockbyte[i] = 199; - for (i = 0; i < msp; ++i) + for (i = 0; i <= msp; ++i) if (g_soundlocks[i] >= 200) g_soundlocks[i] = 199; } @@ -982,7 +982,7 @@ int32_t A_CheckAnySoundPlaying(int32_t i) { int32_t const msp = g_highestSoundIdx; - for (bssize_t j=0; j