Skip to content

Commit

Permalink
actually fix it (genius)
Browse files Browse the repository at this point in the history
  • Loading branch information
Govorunb committed Dec 12, 2023
1 parent 8dcdbee commit 220be68
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions SCHIZO/Jukebox/CustomJukeboxTrackPatches.BelowZero.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections;
using System.Collections.Generic;
using System.IO;
using FMOD;
using FMODUnity;
Expand Down Expand Up @@ -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<BZJukebox.UnlockableTrack, CustomJukeboxTrack> pair in customTracks)
{
if (pair.Value.source != CustomJukeboxTrack.Source.FMODEvent)
BZJukebox.unlockableMusic.Remove(pair.Key);
}
}

[HarmonyPostfix]
Expand Down

0 comments on commit 220be68

Please sign in to comment.