diff --git a/src/GameSrc/digifx.c b/src/GameSrc/digifx.c index 07b37158a..293a8caf9 100644 --- a/src/GameSrc/digifx.c +++ b/src/GameSrc/digifx.c @@ -181,7 +181,7 @@ uchar set_sample_pan_gain(snd_digi_parms *sdp) { for (i = 0; i < NUM_HEIGHT_SEMAPHORS; i++) { h = h_sems[i]; if ((h.x == (x >> 8)) && (h.y == (y >> 8)) && (h.inuse == 1)) { - h.inuse--; + h_sems[i].inuse--; return (TRUE); } } diff --git a/src/MacSrc/SDLSound.c b/src/MacSrc/SDLSound.c index 85e1fceb0..a30cf13f4 100644 --- a/src/MacSrc/SDLSound.c +++ b/src/MacSrc/SDLSound.c @@ -37,7 +37,8 @@ int snd_sample_play(int snd_ref, int len, uchar *smp, struct snd_digi_parms *dpr return ERR_NOEFFECT; } - int channel = Mix_PlayChannel(-1, sample, 0); + int loops = dprm->loops > 0 ? dprm->loops - 1 : -1; + int channel = Mix_PlayChannel(-1, sample, loops); if (channel < 0) { DEBUG("%s: Failed to play sample", __FUNCTION__); Mix_FreeChunk(sample);