From 9736ada9a68709c1aea0093aef12f2855d152b2c Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 8 Oct 2008 22:44:35 +0000 Subject: Fix sound effects! Subversion-branch: /branches/raven-branch Subversion-revision: 1345 --- src/hexen/s_sound.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/hexen/s_sound.c b/src/hexen/s_sound.c index 5588ec05..80d6a85d 100644 --- a/src/hexen/s_sound.c +++ b/src/hexen/s_sound.c @@ -392,6 +392,8 @@ void S_StartSoundAtVolume(mobj_t * origin, int sound_id, int volume) } } + Channel[i].mo = origin; + vol = (SoundCurve[dist] * (snd_MaxVolume * 8) * volume) >> 14; if (origin == players[displayplayer].mo) { @@ -423,11 +425,15 @@ void S_StartSoundAtVolume(mobj_t * origin, int sound_id, int volume) Channel[i].pitch = 127; } #endif + if (S_sfx[sound_id].lumpnum == 0) + { + S_sfx[sound_id].lumpnum = I_GetSfxLumpNum(&S_sfx[sound_id]); + } + Channel[i].handle = I_StartSound(&S_sfx[sound_id], i, vol, sep /* , Channel[i].pitch] */); - Channel[i].mo = origin; Channel[i].sound_id = sound_id; Channel[i].priority = priority; Channel[i].volume = volume; -- cgit v1.2.3