From 58316c821d42bd0315230447e611d73e42e8ac6e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 26 Dec 2016 21:07:21 +0100 Subject: [PATCH] - fixed: The pitch shifting info for sounds needs to be taken from the sfxinfo currently being played, not the one it links to. --- src/s_sound.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/s_sound.cpp b/src/s_sound.cpp index fd15b9491..be1b572f1 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -917,6 +917,7 @@ static FSoundChan *S_StartSound(AActor *actor, const sector_t *sec, const FPolyO // the referenced sound so some additional checks are required int near_limit = sfx->NearLimit; float limit_range = sfx->LimitRange; + auto pitchmask = sfx->PitchMask; rolloff = &sfx->Rolloff; // Resolve player sounds, random sounds, and aliases @@ -1081,9 +1082,9 @@ static FSoundChan *S_StartSound(AActor *actor, const sector_t *sec, const FPolyO } // Vary the sfx pitches. - if (sfx->PitchMask != 0) + if (pitchmask != 0) { - pitch = NORM_PITCH - (M_Random() & sfx->PitchMask) + (M_Random() & sfx->PitchMask); + pitch = NORM_PITCH - (M_Random() & pitchmask) + (M_Random() & pitchmask); } else {