mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix stupid broken code but still doesn't work
This commit is contained in:
parent
1b7a5d2631
commit
e4e4e20ff4
@ -6,7 +6,7 @@ using UnityEngine;
|
|||||||
namespace NewHorizons.Patches;
|
namespace NewHorizons.Patches;
|
||||||
|
|
||||||
[HarmonyPatch(typeof(GlobalMusicController))]
|
[HarmonyPatch(typeof(GlobalMusicController))]
|
||||||
public class GlobalMusicControllerPatches
|
public static class GlobalMusicControllerPatches
|
||||||
{
|
{
|
||||||
private static AudioDetector _audioDetector;
|
private static AudioDetector _audioDetector;
|
||||||
|
|
||||||
@ -29,19 +29,19 @@ public class GlobalMusicControllerPatches
|
|||||||
// Find the first part of the boolean assignment
|
// Find the first part of the boolean assignment
|
||||||
.Start()
|
.Start()
|
||||||
.MatchForward(true,
|
.MatchForward(true,
|
||||||
new CodeMatch(OpCodes.Call, typeof(Locator), nameof(Locator.GetPlayerSectorDetector)),
|
new CodeMatch(OpCodes.Call, AccessTools.Method(typeof(Locator), nameof(Locator.GetPlayerSectorDetector))),
|
||||||
new CodeMatch(OpCodes.Callvirt, typeof(PlayerSectorDetector), nameof(PlayerSectorDetector.InBrambleDimension)),
|
new CodeMatch(OpCodes.Callvirt, AccessTools.Method(typeof(PlayerSectorDetector), nameof(PlayerSectorDetector.InBrambleDimension))),
|
||||||
new CodeMatch(OpCodes.Brfalse_S)
|
new CodeMatch(OpCodes.Brfalse_S)
|
||||||
)
|
)
|
||||||
// Insert a new check to it pointing to the same label as the others
|
// Insert a new check to it pointing to the same label as the others
|
||||||
.Insert(
|
.Insert(
|
||||||
new CodeMatch(OpCodes.Call, typeof(GlobalMusicControllerPatches), nameof(GlobalMusicControllerPatches.IsPlayerInNoAudioVolumes)),
|
new CodeMatch(OpCodes.Call, AccessTools.Method(typeof(GlobalMusicControllerPatches), nameof(GlobalMusicControllerPatches.IsPlayerInNoAudioVolumes))),
|
||||||
new CodeMatch(OpCodes.Brfalse_S, label)
|
new CodeMatch(OpCodes.Brfalse_S, label)
|
||||||
)
|
)
|
||||||
.InstructionEnumeration();
|
.InstructionEnumeration();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool IsPlayerInNoAudioVolumes()
|
public static bool IsPlayerInNoAudioVolumes()
|
||||||
{
|
{
|
||||||
if (_audioDetector == null) _audioDetector = Object.FindObjectOfType<AudioDetector>();
|
if (_audioDetector == null) _audioDetector = Object.FindObjectOfType<AudioDetector>();
|
||||||
return _audioDetector._activeVolumes.Count == 0;
|
return _audioDetector._activeVolumes.Count == 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user