Complaints from wyrm

This commit is contained in:
xen-42 2024-10-26 19:07:52 -04:00
parent ee8098b1ba
commit a7e446b37b
3 changed files with 15 additions and 0 deletions

View File

@ -440,6 +440,11 @@ namespace NewHorizons.Builder.ShipLog
private static MapModeObject ConstructPrimaryNode(List<NewHorizonsBody> bodies) private static MapModeObject ConstructPrimaryNode(List<NewHorizonsBody> bodies)
{ {
float DistanceFromPrimary(NewHorizonsBody body)
{
return Mathf.Max(body.Config.Orbit.semiMajorAxis, body.Config.Orbit.staticPosition?.Length() ?? 0f);
}
foreach (NewHorizonsBody body in bodies.Where(b => b.Config.Base.centerOfSolarSystem)) foreach (NewHorizonsBody body in bodies.Where(b => b.Config.Base.centerOfSolarSystem))
{ {
bodies.Sort((b, o) => b.Config.Orbit.semiMajorAxis.CompareTo(o.Config.Orbit.semiMajorAxis)); bodies.Sort((b, o) => b.Config.Orbit.semiMajorAxis.CompareTo(o.Config.Orbit.semiMajorAxis));

View File

@ -287,6 +287,14 @@ namespace NewHorizons.External.Configs
// Disable map marker for dream dimensions // Disable map marker for dream dimensions
if (Dream != null && Dream.inDreamWorld) MapMarker.enabled = false; if (Dream != null && Dream.inDreamWorld) MapMarker.enabled = false;
// User error #983
// This will not catch if they wrote the two names slightly differently but oh well don't be stupid
// Ideally we should just check for loops in PlanetGraph
if (Orbit.primaryBody == name)
{
throw new Exception($"You set {name} to orbit itself, that is invalid. The planet will not load.");
}
} }
public void Migrate() public void Migrate()

View File

@ -27,6 +27,8 @@ namespace NewHorizons.External.SerializableData
return new Vector3(vec.x, vec.y, vec.z); return new Vector3(vec.x, vec.y, vec.z);
} }
public float Length() => Mathf.Sqrt(x * x + y * y + z * z);
public override string ToString() => $"{x}, {y}, {z}"; public override string ToString() => $"{x}, {y}, {z}";
} }
} }