filter out goofy error

This commit is contained in:
JohnCorby 2022-12-28 12:06:49 -08:00
parent 4488390bd9
commit f8de674a6d

View File

@ -1,10 +1,11 @@
using HarmonyLib; using HarmonyLib;
using NewHorizons.Handlers; using NewHorizons.Handlers;
using OWML.Logging;
namespace NewHorizons.Patches namespace NewHorizons.Patches
{ {
[HarmonyPatch] [HarmonyPatch]
public static class StreamingManagerPatches public static class StreamingPatches
{ {
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(StreamingManager), nameof(StreamingManager.UnloadStreamingAssets))] [HarmonyPatch(typeof(StreamingManager), nameof(StreamingManager.UnloadStreamingAssets))]
@ -12,6 +13,14 @@ namespace NewHorizons.Patches
{ {
// Only let it unload stuff that isn't being used // Only let it unload stuff that isn't being used
return !StreamingHandler.IsBundleInUse(assetBundleName); return !StreamingHandler.IsBundleInUse(assetBundleName);
} }
[HarmonyPrefix]
[HarmonyPatch(typeof(UnityLogger), "OnLogMessageReceived")]
public static bool UnityLogger_OnLogMessageReceived(string message)
{
// Filter out goofy error that doesn't actually break anything
return !message.Contains(" is out of bounds (size=0)");
}
} }
} }