Rename sphereOfInfluence to soiOverride

This commit is contained in:
Nick 2022-06-15 14:06:34 -04:00
parent df66d4ef8d
commit e833512bda
5 changed files with 255 additions and 250 deletions

View File

@ -18,7 +18,7 @@ namespace NewHorizons.Builder.General
// To let you actually orbit things the way you would expect we cap this at 4x the diameter if its not a star or black hole (this is what giants deep has)
if (config.Star == null && config.Singularity == null) gravityRadius = Mathf.Min(gravityRadius, 4 * config.Base.surfaceSize);
else gravityRadius = Mathf.Min(gravityRadius, 15 * config.Base.surfaceSize);
if (config.Base.sphereOfInfluence != 0f) gravityRadius = config.Base.sphereOfInfluence;
if (config.Base.soiOverride != 0f) gravityRadius = config.Base.soiOverride;
var gravityGO = new GameObject("GravityWell");
gravityGO.transform.parent = planetGO.transform;

View File

@ -57,7 +57,7 @@ namespace NewHorizons.Builder.Orbital
// Other stuff to make the fake barycenter not interact with anything in any way
fakeMassConfig.name = config.name + "_FakeBarycenterMass";
fakeMassConfig.Base.sphereOfInfluence = 0;
fakeMassConfig.Base.soiOverride = 0;
fakeMassConfig.Base.hasMapMarker = false;
fakeMassConfig.ReferenceFrame.hideInMap = true;

View File

@ -245,6 +245,8 @@ namespace NewHorizons.External.Configs
foreach (var tornado in Props.tornados)
if (tornado.downwards)
tornado.type = PropModule.TornadoInfo.TornadoType.Downwards;
if (Base.sphereOfInfluence != 0f) Base.soiOverride = Base.sphereOfInfluence;
}
}
}

View File

@ -69,7 +69,7 @@ namespace NewHorizons.External.Modules
/// <summary>
/// An override for the radius of the planet's gravitational sphere of influence. Optional
/// </summary>
public float sphereOfInfluence;
public float soiOverride;
/// <summary>
/// The acceleration due to gravity felt as the surfaceSize. Timber Hearth has 12 for reference
@ -112,6 +112,9 @@ namespace NewHorizons.External.Modules
[Obsolete("CloakRadius is deprecated, please use CloakModule instead")]
public float cloakRadius;
[Obsolete("SphereOfInfluence is deprecated, please use soiOverride instead")]
public float sphereOfInfluence;
#endregion Obsolete
}
}

View File

@ -365,7 +365,7 @@ namespace NewHorizons.Handlers
{
var atmoSize = body.Config.Atmosphere != null ? body.Config.Atmosphere.size : 0f;
float sphereOfInfluence = Mathf.Max(Mathf.Max(atmoSize, 50), body.Config.Base.surfaceSize * 2f);
var overrideSOI = body.Config.Base.sphereOfInfluence;
var overrideSOI = body.Config.Base.soiOverride;
if (overrideSOI != 0) sphereOfInfluence = overrideSOI;
return sphereOfInfluence;
}