[iortcw] 15/152: All: Fix a couple of sound bugs

Simon McVittie smcv at debian.org
Fri Sep 8 10:39:39 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag 1.5a
in repository iortcw.

commit 454d0be888380172f2c4c3f1e0aa4c788162fe38
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date:   Tue Jan 19 16:35:27 2016 -0500

    All: Fix a couple of sound bugs
---
 MP/code/client/snd_dma.c    |  3 +--
 MP/code/client/snd_openal.c | 18 +++++++++---------
 SP/code/client/snd_dma.c    |  5 ++---
 SP/code/client/snd_openal.c | 18 +++++++++---------
 4 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/MP/code/client/snd_dma.c b/MP/code/client/snd_dma.c
index c7e2f1f..93d20f7 100644
--- a/MP/code/client/snd_dma.c
+++ b/MP/code/client/snd_dma.c
@@ -615,7 +615,7 @@ static void S_Base_MainStartSound( vec3_t origin, int entityNum, int entchannel,
 	int		inplay, allowed;
 	qboolean	fullVolume;
 
-	if ( !s_soundStarted || s_soundMuted || ( clc.state != CA_ACTIVE && clc.state != CA_DISCONNECTED ) ) {
+	if ( !s_soundStarted || s_soundMuted ) {
 		return;
 	}
 
@@ -720,7 +720,6 @@ static void S_Base_MainStartSound( vec3_t origin, int entityNum, int entchannel,
 					continue;
 				}
 			}
-
 		}
 	}
 
diff --git a/MP/code/client/snd_openal.c b/MP/code/client/snd_openal.c
index f159954..e45f772 100644
--- a/MP/code/client/snd_openal.c
+++ b/MP/code/client/snd_openal.c
@@ -1111,15 +1111,6 @@ srcHandle_t S_AL_SrcAlloc( sfxHandle_t sfx, alSrcPriority_t priority, int entnum
 				continue;
 			}
 
-			// re-use channel if applicable
-			if ( curSource->sfx == sfx && !cutDuplicateSound ) {
-				cutDuplicateSound = qtrue;
-				S_AL_SrcKill(i);
-				if (empty == -1)
-					empty = i;
-				continue;
-			}
-
 			// cutoff sounds that expect to be overwritten
 			if ( curSource->flags & SND_OKTOCUT ) {
 				S_AL_SrcKill(i);
@@ -1137,6 +1128,15 @@ srcHandle_t S_AL_SrcAlloc( sfxHandle_t sfx, alSrcPriority_t priority, int entnum
 					continue;
 				}
 			}
+
+			// re-use channel if applicable
+			if ( curSource->channel != -1 && curSource->sfx == sfx && !cutDuplicateSound ) {
+				cutDuplicateSound = qtrue;
+				S_AL_SrcKill(i);
+				if (empty == -1)
+					empty = i;
+				continue;
+			}
 		}
 	}
 
diff --git a/SP/code/client/snd_dma.c b/SP/code/client/snd_dma.c
index ddb6965..d32df93 100644
--- a/SP/code/client/snd_dma.c
+++ b/SP/code/client/snd_dma.c
@@ -619,7 +619,7 @@ static void S_Base_MainStartSound( vec3_t origin, int entityNum, int entchannel,
 	int		inplay, allowed;
 	qboolean	fullVolume;
 
-	if ( !s_soundStarted || s_soundMuted || ( clc.state != CA_ACTIVE && clc.state != CA_DISCONNECTED ) ) {
+	if ( !s_soundStarted || s_soundMuted ) {
 		return;
 	}
 
@@ -730,13 +730,12 @@ static void S_Base_MainStartSound( vec3_t origin, int entityNum, int entchannel,
 					continue;
 				}
 			}
-
 		}
 	}
 
 	// re-use channel if applicable
 	for ( i = 0 ; i < MAX_CHANNELS ; i++ ) {
-		if ( s_channels[i].entnum == entityNum && s_channels[i].entchannel == entchannel ) {
+		if ( s_channels[i].entnum == entityNum && s_channels[i].entchannel == entchannel && entchannel != CHAN_AUTO ) {
 			if ( !( s_channels[i].flags & SND_NOCUT ) && s_channels[i].thesfx == sfx ) {
 				ch = &s_channels[i];
 				break;
diff --git a/SP/code/client/snd_openal.c b/SP/code/client/snd_openal.c
index 04112a6..e668b3c 100644
--- a/SP/code/client/snd_openal.c
+++ b/SP/code/client/snd_openal.c
@@ -1112,15 +1112,6 @@ srcHandle_t S_AL_SrcAlloc( sfxHandle_t sfx, alSrcPriority_t priority, int entnum
 				continue;
 			}
 
-			// re-use channel if applicable
-			if ( curSource->sfx == sfx && !cutDuplicateSound ) {
-				cutDuplicateSound = qtrue;
-				S_AL_SrcKill(i);
-				if (empty == -1)
-					empty = i;
-				continue;
-			}
-
 			// RF, let client voice sounds be overwritten
 			if ( entnum < MAX_CLIENTS && curSource->channel != -1 && curSource->channel != CHAN_AUTO && curSource->channel != CHAN_WEAPON ) {
 				S_AL_SrcKill(i);
@@ -1146,6 +1137,15 @@ srcHandle_t S_AL_SrcAlloc( sfxHandle_t sfx, alSrcPriority_t priority, int entnum
 					continue;
 				}
 			}
+
+			// re-use channel if applicable
+			if ( curSource->channel != -1 && curSource->channel != CHAN_AUTO && curSource->sfx == sfx && !cutDuplicateSound ) {
+				cutDuplicateSound = qtrue;
+				S_AL_SrcKill(i);
+				if (empty == -1)
+					empty = i;
+				continue;
+			}
 		}
 	}
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git



More information about the Pkg-games-commits mailing list