diff --git a/SCHIZO/Jukebox/CustomJukeboxTrackPatches.BelowZero.cs b/SCHIZO/Jukebox/CustomJukeboxTrackPatches.BelowZero.cs index 29482d09..db22beb5 100644 --- a/SCHIZO/Jukebox/CustomJukeboxTrackPatches.BelowZero.cs +++ b/SCHIZO/Jukebox/CustomJukeboxTrackPatches.BelowZero.cs @@ -1,4 +1,5 @@ using System.Collections; +using System.Collections.Generic; using System.IO; using FMOD; using FMODUnity; @@ -49,12 +50,15 @@ private static IEnumerator InitJukebox() public static class AwakeWorkaround { // base Awake assumes all unlockable tracks are events - // so we need to add ours afterwards (and remove them on game unload) + // so we need to remove ours (and readd them afterwards) [HarmonyPrefix] public static void ClearCustomTracks() { - foreach (BZJukebox.UnlockableTrack trackId in customTracks.Keys) - BZJukebox.unlockableMusic.Remove(trackId); + foreach (KeyValuePair pair in customTracks) + { + if (pair.Value.source != CustomJukeboxTrack.Source.FMODEvent) + BZJukebox.unlockableMusic.Remove(pair.Key); + } } [HarmonyPostfix]