Skip to content

Commit

Permalink
1.14.2 (#691)
Browse files Browse the repository at this point in the history
## Improvements
- Renamed `addPhysics` to `pushable` really quick before anyone could
use it.
  • Loading branch information
JohnCorby committed Aug 11, 2023
2 parents dacaf6e + d926e0d commit c9511a1
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 13 deletions.
10 changes: 4 additions & 6 deletions NewHorizons/Builder/General/RigidBodyBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,16 @@ public static OWRigidbody Make(GameObject body, float sphereOfInfluence, PlanetC
owRigidBody.EnableKinematicSimulation();
rigidBody.mass = 10000;

if (config.Base.addPhysics)
if (config.Base.pushable)
{
// hack: make all mesh colliders convex
// triggers are already convex
// prints errors for non readable meshes but whatever
// doesnt work for some non readable meshes but whatever
foreach (var meshCollider in body.GetComponentsInChildren<MeshCollider>(true))
meshCollider.convex = true;

var shape = body.AddComponent<SphereShape>();
shape._collisionMode = Shape.CollisionMode.Detector;
shape._layerMask = (int)(Shape.Layer.Default | Shape.Layer.Gravity);
shape._radius = config.Base.surfaceSize;
// backup collider in case of no convex colliders
body.AddComponent<SphereCollider>().radius = config.Base.surfaceSize;

var impactSensor = body.AddComponent<ImpactSensor>();
var audioSource = body.AddComponent<AudioSource>();
Expand Down
2 changes: 1 addition & 1 deletion NewHorizons/Builder/Orbital/OrbitlineBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static OrbitLine Make(GameObject planetGO, NHAstroObject astroObject, boo
Delay.FireOnNextUpdate(orbitLine.InitializeLineRenderer);

// If the planet has physics and a regular orbit line, make sure that when it's bumped into the old orbit line vanishes
if (config.Base.addPhysics && !config.Orbit.trackingOrbitLine)
if (config.Base.pushable && !config.Orbit.trackingOrbitLine)
{
var impactSensor = planetGO.GetComponent<ImpactSensor>();
impactSensor.OnImpact += (ImpactData _) =>
Expand Down
2 changes: 1 addition & 1 deletion NewHorizons/Components/AddPhysics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private IEnumerator Start()

// hack: make all mesh colliders convex
// triggers are already convex
// prints errors for non readable meshes but whatever
// doesnt work for some non readable meshes but whatever
foreach (var meshCollider in GetComponentsInChildren<MeshCollider>(true))
meshCollider.convex = true;

Expand Down
2 changes: 1 addition & 1 deletion NewHorizons/External/Modules/BaseModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public class BaseModule
/// This is meant for stuff like satellites which are relatively simple and can be de-orbited.
/// If you are using an orbit line but a tracking line, it will be removed when the planet is bumped in to.
/// </summary>
public bool addPhysics;
public bool pushable;

#region Obsolete

Expand Down
2 changes: 0 additions & 2 deletions NewHorizons/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,6 @@ public void LoadConfigs(IModBehaviour mod)
{
try
{
if (mod.ModHelper.Manifest.Filename.Contains("Extinction")) return;

if (_firstLoad)
{
MountedAddons.Add(mod);
Expand Down
2 changes: 1 addition & 1 deletion NewHorizons/Schemas/body_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@
"format": "int32",
"default": 0
},
"addPhysics": {
"pushable": {
"type": "boolean",
"description": "Apply physics to this planet when you bump into it. Will have a spherical collider the size of surfaceSize. \nFor custom colliders they have to all be convex and you can leave surface size as 0.\nThis is meant for stuff like satellites which are relatively simple and can be de-orbited.\nIf you are using an orbit line but a tracking line, it will be removed when the planet is bumped in to."
}
Expand Down
2 changes: 1 addition & 1 deletion NewHorizons/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"author": "xen, Bwc9876, clay, MegaPiggy, John, Trifid, Hawkbar, Book",
"name": "New Horizons",
"uniqueName": "xen.NewHorizons",
"version": "1.14.1",
"version": "1.14.2",
"owmlVersion": "2.9.3",
"dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ],
"conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_CommonResources" ],
Expand Down

0 comments on commit c9511a1

Please sign in to comment.