Skip to content

Commit

Permalink
Fix break when no alert track
Browse files Browse the repository at this point in the history
Fixes #29
  • Loading branch information
potatoes1286 committed Jun 25, 2024
1 parent 6d9e011 commit 42015f5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Soundtrack/TnHSoundtrackInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ public void FixedUpdate() {
}
}
else { //exiting alert mode
// Prevent if no alert was played, from take being played *again*
if (CurrentTrack.Type == "take")
return;
// Handle if changed area mid fight
if (changedAreaMidFight) {
changedAreaMidFight = false;
Expand Down Expand Up @@ -368,6 +371,10 @@ public static bool PlayWinTrack() {
[HarmonyPatch(typeof(TNH_Manager), "Start")]
[HarmonyPostfix]
public static void InitializeTnHSoundtrackInterface(ref TNH_Manager __instance) {
if (!PluginMain.IsSoundtrack.Value)
return;


Manager = __instance;
isInstitutionMode = __instance.UsesInstitutionMusic;

Expand All @@ -378,8 +385,8 @@ public static void InitializeTnHSoundtrackInterface(ref TNH_Manager __instance)
return;
}

if(PluginMain.IsSoundtrack.Value || SoundtrackAPI.IsMix)
__instance.gameObject.AddComponent<TnHSoundtrackInterface>();

__instance.gameObject.AddComponent<TnHSoundtrackInterface>();
// Turn off fmod.
GM.TNH_Manager.FMODController.MasterBus.setMute(true);
//Set hold music.
Expand Down

0 comments on commit 42015f5

Please sign in to comment.