Skip to content

Commit

Permalink
Fix SectorModel and PlanetATField in headless server
Browse files Browse the repository at this point in the history
  • Loading branch information
starfi5h committed Apr 1, 2024
1 parent dd9a0f7 commit 2364786
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions NebulaPatcher/Patches/Dynamic/Dedicated_Server_Patch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
}

0 comments on commit 2364786

Please sign in to comment.