diff --git a/source/core/music/s_advsound.cpp b/source/core/music/s_advsound.cpp index fa6d874316d..adb17407894 100644 --- a/source/core/music/s_advsound.cpp +++ b/source/core/music/s_advsound.cpp @@ -63,6 +63,7 @@ enum SICommands SI_PitchSetDuke, SI_DukeFlags, SI_Loop, + SI_BloodRelVol, }; @@ -97,6 +98,7 @@ static const char *SICommandStrings[] = "$pitchsetduke", "$dukeflags", "$loop", + "$bloodrelvol", NULL }; @@ -383,7 +385,7 @@ static void S_AddSNDINFO (int lump) } case SI_Loop: { - // dukesound + // loop // Sets loop points for the given sound in samples. Only really useful for WAV - for Ogg and FLAC use the metadata they can contain. sc.MustGetString(); auto sfxid = soundEngine->FindSoundTentative(sc.String, DEFAULT_LIMIT); @@ -395,6 +397,29 @@ static void S_AddSNDINFO (int lump) break; } + case SI_BloodRelVol: { + // bloodrelvol + // Sets Blood's hacky volume modifier. + sc.MustGetString(); + auto sfxid = soundEngine->FindSoundTentative(sc.String, DEFAULT_LIMIT); + auto sfx = soundEngine->GetWritableSfx(sfxid); + sc.MustGetNumber(); + if (isBlood()) + { + auto sfx = soundEngine->GetWritableSfx(sfxid); + if (sfx->UserData.Size() < 1) + { + sfx->UserData.Resize(1); + } + sfx->UserData[0] = sc.Number; + } + else + { + sc.ScriptMessage("'$bloodrelvol' is not available in the current game and will be ignored"); + } + break; + } + default: { // Got a logical sound mapping