mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
field to not check for existing body
This commit is contained in:
parent
5beb803835
commit
b8d7af90f1
5
NewHorizons/External/Configs/PlanetConfig.cs
vendored
5
NewHorizons/External/Configs/PlanetConfig.cs
vendored
@ -64,6 +64,11 @@ namespace NewHorizons.External.Configs
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string[] removeChildren;
|
public string[] removeChildren;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// optimization. turn this off if you know you're generating a new body and aren't worried about other mods editing it.
|
||||||
|
/// </summary>
|
||||||
|
[DefaultValue(true)] public bool checkForExisting = true;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Modules
|
#region Modules
|
||||||
|
|||||||
@ -168,6 +168,8 @@ namespace NewHorizons.Handlers
|
|||||||
|
|
||||||
// I don't remember doing this why is it exceptions what am I doing
|
// I don't remember doing this why is it exceptions what am I doing
|
||||||
GameObject existingPlanet = null;
|
GameObject existingPlanet = null;
|
||||||
|
if (body.Config.checkForExisting)
|
||||||
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
existingPlanet = AstroObjectLocator.GetAstroObject(body.Config.name).gameObject;
|
existingPlanet = AstroObjectLocator.GetAstroObject(body.Config.name).gameObject;
|
||||||
@ -189,6 +191,7 @@ namespace NewHorizons.Handlers
|
|||||||
NHLogger.LogError($"{body.Config.name} was meant to be destroyed, but was not found");
|
NHLogger.LogError($"{body.Config.name} was meant to be destroyed, but was not found");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (existingPlanet != null)
|
if (existingPlanet != null)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user