Manual bramble recursion fix (#480)

Option to manually remove a sender warp for cases where the recursion
scanner fails.
This commit is contained in:
TerrificTrifid 2023-01-01 20:20:24 -06:00 committed by GitHub
commit 1347131d68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 0 deletions

View File

@ -365,6 +365,15 @@ namespace NewHorizons.Builder.Props
var success = PairEntrance(innerFogWarpVolume, config.linksTo); var success = PairEntrance(innerFogWarpVolume, config.linksTo);
if (!success) RecordUnpairedNode(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 // Cleanup for dimension exits
if (config.name != null) if (config.name != null)
{ {

View File

@ -134,6 +134,12 @@ namespace NewHorizons.External.Modules
/// </summary> /// </summary>
public int[] possibleExits; public int[] possibleExits;
/// <summary>
/// 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.
/// </summary>
[DefaultValue(false)] public bool preventRecursionCrash = false;
#region Obsolete #region Obsolete
[Obsolete("farFogTint is deprecated, please use fogTint instead")] [Obsolete("farFogTint is deprecated, please use fogTint instead")]

View File

@ -661,6 +661,11 @@
"type": "integer", "type": "integer",
"format": "int32" "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
} }
} }
}, },