From 3f91f70571a8ed52d134c8f51422fc3fdd402359 Mon Sep 17 00:00:00 2001 From: FreezeDriedMangoes Date: Thu, 14 Jul 2022 23:13:44 -0400 Subject: [PATCH] fixed screen fog not scaling to the node size and fixed nodes not warping player if they were scaled down too much --- NewHorizons/Patches/BramblePatches.cs | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 NewHorizons/Patches/BramblePatches.cs diff --git a/NewHorizons/Patches/BramblePatches.cs b/NewHorizons/Patches/BramblePatches.cs new file mode 100644 index 00000000..bbd5e33b --- /dev/null +++ b/NewHorizons/Patches/BramblePatches.cs @@ -0,0 +1,31 @@ +using HarmonyLib; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NewHorizons.Patches +{ + [HarmonyPatch] + public class BramblePatches + { + [HarmonyPrefix] + [HarmonyPatch(typeof(SphericalFogWarpVolume), nameof(SphericalFogWarpVolume.IsProbeOnly))] + public static bool SphericalFogWarpVolume_IsProbeOnly(SphericalFogWarpVolume __instance, ref bool __result) + { + __result = false; + return false; + } + + [HarmonyPrefix] + [HarmonyPatch(typeof(FogWarpVolume), nameof(FogWarpVolume.GetFogThickness))] + public static bool FogWarpVolume_GetFogThickness(FogWarpVolume __instance, ref float __result) + { + if (__instance is InnerFogWarpVolume sph) __result = sph._exitRadius; + else __result = 50; // 50f is hardcoded as the return value in the base game + + return false; + } + } +}