From 23647868b833da0c3a8678c0cf7f605bf6d5d1c4 Mon Sep 17 00:00:00 2001 From: starfish <50672801+starfi5h@users.noreply.github.com> Date: Tue, 2 Apr 2024 02:36:30 +0800 Subject: [PATCH] Fix SectorModel and PlanetATField in headless server --- .../Patches/Dynamic/Dedicated_Server_Patch.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/NebulaPatcher/Patches/Dynamic/Dedicated_Server_Patch.cs b/NebulaPatcher/Patches/Dynamic/Dedicated_Server_Patch.cs index df33b3868..71d34b552 100644 --- a/NebulaPatcher/Patches/Dynamic/Dedicated_Server_Patch.cs +++ b/NebulaPatcher/Patches/Dynamic/Dedicated_Server_Patch.cs @@ -49,6 +49,7 @@ public static void GameMainBegin_Postfix() [HarmonyPatch(typeof(GameData), nameof(GameData.OnDraw))] [HarmonyPatch(typeof(GameData), nameof(GameData.OnPostDraw))] [HarmonyPatch(typeof(FactoryModel), nameof(FactoryModel.LateUpdate))] + [HarmonyPatch(typeof(SectorModel), nameof(SectorModel.LateUpdate))] public static bool OnDraw_Prefix() { return false; @@ -159,4 +160,16 @@ public static bool DoMeshGeneration_Prefix() { return false; } + + [HarmonyPostfix] + [HarmonyPatch(typeof(PlanetATField), nameof(PlanetATField.RecalculatePhysicsShape))] + public static void RecalculatePhysicsShape_Postfix(PlanetATField __instance) + { + // vanilla use GPU to calculate the shape of shield that is not fully covered the whole planet + // In this patch it will act as it has been fully covered to make the planet shield effective + if (!__instance.isEmpty) + { + __instance.isSpherical = true; + } + } }