Commit 25b63ddc authored by Richard Gobeille's avatar Richard Gobeille
Browse files

Duke3d: properly handle the rejection of sound data that can't be identified by file header again

parent 1b880e5a
......@@ -908,16 +908,19 @@ int S_PlaySound3D(int num, int spriteNum, const vec3_t& pos)
int const voice = FX_Play3D(snd->ptr, snd->len, repeatp ? FX_LOOP : FX_ONESHOT, pitch, sndang >> 4, sndist >> 6,
snd->priority, snd->volume, (sndNum * MAXSOUNDINSTANCES) + sndSlot);
snd->voices[sndSlot].handle = voice;
if (voice <= FX_Ok)
{
OSD_Printf("S_PlaySound3D(): error playing %s\n", snd->filename);
bitmap_clear(&snd->playing, sndSlot);
#ifdef CACHING_DOESNT_SUCK
g_soundlocks[sndNum]--;
#endif
return -1;
}
snd->voices[sndSlot].handle = voice;
return voice;
}
......@@ -970,16 +973,19 @@ int S_PlaySound(int num)
LOUDESTVOLUME, snd->len, snd->volume, (num * MAXSOUNDINSTANCES) + sndnum)
: FX_Play3D(snd->ptr, snd->len, FX_ONESHOT, pitch, 0, 255 - LOUDESTVOLUME, snd->priority, snd->volume,
(num * MAXSOUNDINSTANCES) + sndnum);
snd->voices[sndnum].handle = voice;
if (voice <= FX_Ok)
{
OSD_Printf("S_PlaySound(): error playing %s\n", snd->filename);
bitmap_clear(&snd->playing, sndnum);
#ifdef CACHING_DOESNT_SUCK
g_soundlocks[num]--;
#endif
return -1;
}
snd->voices[sndnum].handle = voice;
return voice;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment