Skip to content

Commit 85fa0cf

Browse files
authored
Merge pull request #26 from Sigma88/storageTest
Storage test
2 parents 08fd4a0 + ed729f0 commit 85fa0cf

File tree

4 files changed

+103
-102
lines changed

4 files changed

+103
-102
lines changed
-1 KB
Binary file not shown.
-1 KB
Binary file not shown.

[Source]/SigmaBinary/LateFixes.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
using UnityEngine;
66

7+
using Kopernicus;
78
using Kopernicus.Components;
89
using Kopernicus.Configuration;
910
using Kopernicus.OnDemand;
10-
using System.Threading;
11-
using System.Reflection;
11+
1212
using KSP.UI.Screens;
1313

1414

@@ -76,22 +76,22 @@ public static void TextureFixer(Body body1, Body body2, List<Body> list)
7676
else
7777
pBody.generatedBody.celestialBody.gameObject.AddComponent<NameChanger>().newName = "3.1415";
7878
}
79-
else if (Kopernicus.Templates.orbitPatches.ContainsKey(pBody.name) && Kopernicus.Templates.orbitPatches[pBody.name].GetValue("referenceBody") == "Sun")
79+
else if (pBody.generatedBody.celestialBody.Has("orbitPatches") && pBody.generatedBody.celestialBody.Get<ConfigNode>("orbitPatches").GetValue("referenceBody") == "Sun")
8080
{
8181
pList.Add(pBody.generatedBody.celestialBody, pBody.generatedBody.orbitDriver.orbit.semiMajorAxis);
8282
}
83-
else if (pBody.orbit.referenceBody == "Sun" && !(Kopernicus.Templates.orbitPatches.ContainsKey(pBody.name) && Kopernicus.Templates.orbitPatches[pBody.name].GetValue("referenceBody") != "Sun"))
83+
else if (pBody.orbit.referenceBody == "Sun" && !(pBody.generatedBody.celestialBody.Has("orbitPatches") && pBody.generatedBody.celestialBody.Get<ConfigNode>("orbitPatches").GetValue("referenceBody") != "Sun"))
8484
{
8585
if (!(pBody.name == "Kerbin" && SigmaBinary.kerbinFixer != "Sun"))
8686
{
8787
pList.Add(pBody.generatedBody.celestialBody, pBody.generatedBody.orbitDriver.orbit.semiMajorAxis);
8888
}
8989
}
9090

91-
if (pList.ContainsKey(pBody.generatedBody.celestialBody) && Kopernicus.Templates.orbitPatches.ContainsKey(pBody.name) && Kopernicus.Templates.orbitPatches[pBody.name].GetValue("semiMajorAxis") != null)
91+
if (pList.ContainsKey(pBody.generatedBody.celestialBody) && pBody.generatedBody.celestialBody.Has("orbitPatches") && pBody.generatedBody.celestialBody.Get<ConfigNode>("orbitPatches").GetValue("semiMajorAxis") != null)
9292
{
9393
NumericParser<double> sma = new NumericParser<double>();
94-
sma.SetFromString(Kopernicus.Templates.orbitPatches[pBody.name].GetValue("semiMajorAxis"));
94+
sma.SetFromString(pBody.generatedBody.celestialBody.Get<ConfigNode>("orbitPatches").GetValue("semiMajorAxis"));
9595
pList[pBody.generatedBody.celestialBody] = sma.value;
9696
}
9797
}

0 commit comments

Comments
 (0)