From ae9a334f5a532c3df5148f9080dd96e77d30431b Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Fri, 25 Mar 2022 10:33:23 -0700 Subject: [PATCH] remove TEMP_ShipBugFix.cs --- QSB/TEMP_ShipBugFix.cs | 81 ------------------------------------------ 1 file changed, 81 deletions(-) delete mode 100644 QSB/TEMP_ShipBugFix.cs diff --git a/QSB/TEMP_ShipBugFix.cs b/QSB/TEMP_ShipBugFix.cs deleted file mode 100644 index 50b49bf1..00000000 --- a/QSB/TEMP_ShipBugFix.cs +++ /dev/null @@ -1,81 +0,0 @@ -using HarmonyLib; -using QSB.Patches; -using QSB.Utility; -using UnityEngine; - -namespace QSB; - -/// -/// TODO: remove this when the bug is fixed in vanilla -/// -[HarmonyPatch(typeof(StreamingGroup))] -internal class TEMP_ShipBugFix : QSBPatch -{ - public override QSBPatchTypes Type => QSBPatchTypes.OnModStart; - - [HarmonyPrefix] - [HarmonyPatch(nameof(StreamingGroup.LoadRequiredColliders))] - private static bool LoadRequiredColliders(StreamingGroup __instance, int priorityBias) - { - StreamingManager.LoadStreamingAssets(__instance._terrainColliderSceneMeshBundle, 18 + priorityBias); - StreamingManager.LoadStreamingAssets(__instance._structuresColliderSceneMeshBundle, 17 + priorityBias); - StreamingManager.LoadStreamingAssets(__instance._batchedRenderersColliderBundle, 18 + priorityBias); - - return false; - } - - [HarmonyPrefix] - [HarmonyPatch(nameof(StreamingGroup.UnloadRequiredColliders))] - private static bool UnloadRequiredColliders(StreamingGroup __instance, float delay) - { - StreamingManager.UnloadStreamingAssets(__instance._terrainColliderSceneMeshBundle, delay); - StreamingManager.UnloadStreamingAssets(__instance._structuresColliderSceneMeshBundle, delay); - StreamingManager.UnloadStreamingAssets(__instance._batchedRenderersColliderBundle, delay); - - return false; - } - - [HarmonyPrefix] - [HarmonyPatch(nameof(StreamingGroup.LoadRequiredAssets))] - private static bool LoadRequiredAssets(StreamingGroup __instance, int priorityBias) - { - if (__instance._locked) - { - return false; - } - - StreamingManager.LoadStreamingAssets(__instance._bakedTerrainsBundle, 8 + priorityBias); - StreamingManager.LoadStreamingAssets(__instance._batchedRenderersBundle, 8 + priorityBias); - StreamingManager.LoadStreamingAssets(__instance._bakedVISRenderersBundle, 8 + priorityBias); - StreamingManager.LoadStreamingAssets(__instance._terrainSceneMeshBundle, 8 + priorityBias); - StreamingManager.LoadStreamingAssets(__instance._structuresSceneMeshBundle, 7 + priorityBias); - if (!__instance._streamCollidersOnWakeUp) - { - StreamingManager.LoadStreamingAssets(__instance._terrainColliderSceneMeshBundle, 18 + priorityBias); - StreamingManager.LoadStreamingAssets(__instance._structuresColliderSceneMeshBundle, 17 + priorityBias); - StreamingManager.LoadStreamingAssets(__instance._batchedRenderersColliderBundle, 18 + priorityBias); - } - - __instance._requiredAssetsPriorityBias = priorityBias; - - return false; - } - - [HarmonyPrefix] - [HarmonyPatch(nameof(StreamingGroup.UnloadRequiredAssets))] - private static bool UnloadRequiredAssets(StreamingGroup __instance, float delay) - { - if (__instance._locked) - { - return false; - } - - StreamingManager.UnloadStreamingAssets(__instance._bakedTerrainsBundle, delay); - StreamingManager.UnloadStreamingAssets(__instance._batchedRenderersBundle, delay); - StreamingManager.UnloadStreamingAssets(__instance._bakedVISRenderersBundle, delay); - StreamingManager.UnloadStreamingAssets(__instance._terrainSceneMeshBundle, delay); - StreamingManager.UnloadStreamingAssets(__instance._structuresSceneMeshBundle, delay); - - return false; - } -}