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 (#918)
## Bug fixes - Fix inactive signals being used with signalscope strongest signal method. This bug prevented some vanilla frequencies from showing up in custom systems.
This commit is contained in:
commit
d4a50374e9
@ -1,4 +1,6 @@
|
||||
using HarmonyLib;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace NewHorizons.Patches
|
||||
{
|
||||
@ -108,5 +110,12 @@ namespace NewHorizons.Patches
|
||||
_mapSatellite = 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))]
|
||||
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]
|
||||
[HarmonyPatch(nameof(AudioSignal.SignalNameToString))]
|
||||
public static bool AudioSignal_SignalNameToString(SignalName name, ref string __result)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user