Added an optional extra float parameter to $pitchshift. (#1150)

- This allows for setting a randomized range for the pitch each time the sound is initialized.
This commit is contained in:
MajorCooke 2020-08-27 11:49:59 -05:00 committed by GitHub
commit c57e669044
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 2 deletions

View file

@ -1039,13 +1039,21 @@ static void S_AddSNDINFO (int lump)
break;
case SI_PitchSet: {
// $pitchset <logical name> <pitch amount as float>
// $pitchset <logical name> <pitch amount as float> [range maximum]
int sfx;
sc.MustGetString();
sfx = soundEngine->FindSoundTentative(sc.String);
sc.MustGetFloat();
S_sfx[sfx].DefPitch = (float)sc.Float;
if (sc.CheckFloat())
{
S_sfx[sfx].DefPitchMax = (float)sc.Float;
}
else
{
S_sfx[sfx].DefPitchMax = 0;
}
}
break;