From dca563648001d34c5007901587f19de9d796f571 Mon Sep 17 00:00:00 2001
From: TerrificTrifid <99054745+TerrificTrifid@users.noreply.github.com>
Date: Sun, 1 Jan 2023 20:05:32 -0600
Subject: [PATCH 1/2] Manual recursion fix
---
NewHorizons/Builder/Props/BrambleNodeBuilder.cs | 9 +++++++++
NewHorizons/External/Modules/BrambleModule.cs | 6 ++++++
2 files changed, 15 insertions(+)
diff --git a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs
index f3980776..4d2d32ce 100644
--- a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs
+++ b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs
@@ -365,6 +365,15 @@ namespace NewHorizons.Builder.Props
var success = PairEntrance(innerFogWarpVolume, config.linksTo);
if (!success) RecordUnpairedNode(innerFogWarpVolume, config.linksTo);
+ if (config.preventRecursionCrash)
+ {
+ Delay.FireOnNextUpdate(() =>
+ {
+ var destination = GetOuterFogWarpVolumeFromAstroObject(AstroObjectLocator.GetAstroObject(config.linksTo).gameObject);
+ if (destination != null) destination._senderWarps.Remove(innerFogWarpVolume);
+ });
+ }
+
// Cleanup for dimension exits
if (config.name != null)
{
diff --git a/NewHorizons/External/Modules/BrambleModule.cs b/NewHorizons/External/Modules/BrambleModule.cs
index c3405e37..9b98c0de 100644
--- a/NewHorizons/External/Modules/BrambleModule.cs
+++ b/NewHorizons/External/Modules/BrambleModule.cs
@@ -134,6 +134,12 @@ namespace NewHorizons.External.Modules
///
public int[] possibleExits;
+ ///
+ /// If your game hard crashes upon entering bramble, it's most likely because you have indirectly recursive dimensions, i.e. one leads to another that leads back to the first one.
+ /// Set this to true for one of the nodes in the recursion to fix this, at the cost of it no longer showing markers for the scout, ship, etc.
+ ///
+ [DefaultValue(false)] public bool preventRecursionCrash = false;
+
#region Obsolete
[Obsolete("farFogTint is deprecated, please use fogTint instead")]
From c03fb2ed4d3bea84de9a7d04f82d6d7983ebb958 Mon Sep 17 00:00:00 2001
From: Ben C
Date: Mon, 2 Jan 2023 02:08:09 +0000
Subject: [PATCH 2/2] Updated Schemas
---
NewHorizons/Schemas/body_schema.json | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json
index 332e0d4a..c69a205c 100644
--- a/NewHorizons/Schemas/body_schema.json
+++ b/NewHorizons/Schemas/body_schema.json
@@ -661,6 +661,11 @@
"type": "integer",
"format": "int32"
}
+ },
+ "preventRecursionCrash": {
+ "type": "boolean",
+ "description": "If your game hard crashes upon entering bramble, it's most likely because you have indirectly recursive dimensions, i.e. one leads to another that leads back to the first one.\nSet this to true for one of the nodes in the recursion to fix this, at the cost of it no longer showing markers for the scout, ship, etc.",
+ "default": false
}
}
},