summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/i_sdlmusic.c5
-rw-r--r--src/strife/s_sound.c7
2 files changed, 9 insertions, 3 deletions
diff --git a/src/i_sdlmusic.c b/src/i_sdlmusic.c
index e70b2c05..63a3467a 100644
--- a/src/i_sdlmusic.c
+++ b/src/i_sdlmusic.c
@@ -422,7 +422,7 @@ static char *GetSubstituteMusicFile(void *data, size_t data_len)
sha1_context_t context;
sha1_digest_t hash;
char *filename;
- int i;
+ unsigned int i;
// Don't bother doing a hash if we're never going to find anything.
if (subst_music_len == 0)
@@ -734,7 +734,8 @@ static void DumpSubstituteConfig(char *filename)
char name[9];
byte *data;
FILE *fs;
- int lumpnum, h;
+ unsigned int lumpnum;
+ size_t h;
fs = fopen(filename, "w");
diff --git a/src/strife/s_sound.c b/src/strife/s_sound.c
index 7a919737..d22f84e4 100644
--- a/src/strife/s_sound.c
+++ b/src/strife/s_sound.c
@@ -277,7 +277,7 @@ static int S_GetChannel(mobj_t *origin, sfxinfo_t *sfxinfo, boolean isvoice)
channel_t* c;
// Find an open channel
- for (cnum=0 ; cnum<snd_channels ; cnum++)
+ for (cnum=0 ; cnum<snd_channels ; cnum++)
{
if (!channels[cnum].sfxinfo)
{
@@ -286,6 +286,11 @@ static int S_GetChannel(mobj_t *origin, sfxinfo_t *sfxinfo, boolean isvoice)
else if (origin && channels[cnum].origin == origin &&
(isvoice || cnum != i_voicehandle)) // haleyjd
{
+ // haleyjd 20150220: [STRIFE] missing sound channel priority check
+ // Is a higher priority sound by same origin already playing?
+ if(!isvoice && sfxinfo->priority > channels[cnum].sfxinfo->priority)
+ return -1;
+
S_StopChannel(cnum);
break;
}