mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix inactive signals being used with signalscope strongest signal method
This commit is contained in:
parent
9e00c229c7
commit
f313e14ffa
@ -1,4 +1,6 @@
|
|||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace NewHorizons.Patches
|
namespace NewHorizons.Patches
|
||||||
{
|
{
|
||||||
@ -108,5 +110,12 @@ namespace NewHorizons.Patches
|
|||||||
_mapSatellite = null;
|
_mapSatellite = null;
|
||||||
_sunStation = null;
|
_sunStation = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HarmonyPostfix]
|
||||||
|
[HarmonyPatch(nameof(Locator.GetAudioSignals))]
|
||||||
|
public static void Locator_GetAudioSignals(ref List<AudioSignal> __result)
|
||||||
|
{
|
||||||
|
__result = __result.Where(signal => signal.IsActive()).ToList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,6 +11,13 @@ namespace NewHorizons.Patches.SignalPatches
|
|||||||
[HarmonyPatch(typeof(AudioSignal))]
|
[HarmonyPatch(typeof(AudioSignal))]
|
||||||
public static class AudioSignalPatches
|
public static class AudioSignalPatches
|
||||||
{
|
{
|
||||||
|
[HarmonyPostfix]
|
||||||
|
[HarmonyPatch(nameof(AudioSignal.IsActive))]
|
||||||
|
public static void AudioSignal_IsActive(AudioSignal __instance, ref bool __result)
|
||||||
|
{
|
||||||
|
__result = __result && __instance.gameObject.activeInHierarchy;
|
||||||
|
}
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(nameof(AudioSignal.SignalNameToString))]
|
[HarmonyPatch(nameof(AudioSignal.SignalNameToString))]
|
||||||
public static bool AudioSignal_SignalNameToString(SignalName name, ref string __result)
|
public static bool AudioSignal_SignalNameToString(SignalName name, ref string __result)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user