Skip to content

Commit

Permalink
Fix a bug that caused Kopernicus to try to edit the orbit of the sun
Browse files Browse the repository at this point in the history
StollD committed May 25, 2018
1 parent 3d419b9 commit 99f8326
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/Kopernicus/Configuration/ScaledVersionLoader.cs
Original file line number Diff line number Diff line change
@@ -134,7 +134,7 @@ public Material material
[KittopiaUntouchable]
public PlanetTextureExporter.TextureOptions options
{
get { return Value.Get("textureOptions", new PlanetTextureExporter.TextureOptions()); }
get { return Value.Get<PlanetTextureExporter.TextureOptions>("textureOptions", null); }
set { Value.Set("textureOptions", value); }
}

@@ -340,6 +340,11 @@ public ScaledVersionLoader()
Value.scaledBody.AddComponent<MeshRenderer>();
Value.scaledBody.GetComponent<Renderer>().material = null;
}

if (options == null)
{
options = new PlanetTextureExporter.TextureOptions();
}
}

/// <summary>
@@ -406,6 +411,11 @@ public ScaledVersionLoader(CelestialBody body)
{
material = new EmissiveMultiRampSunspotsLoader(material);
}

if (options == null)
{
options = new PlanetTextureExporter.TextureOptions();
}
}
}
}
1 change: 0 additions & 1 deletion src/Kopernicus/Storage.cs
Original file line number Diff line number Diff line change
@@ -109,7 +109,6 @@ public static T Get<T>(this CelestialBody body, String id, T defaultValue)
{
return body.Get<T>(id);
}
body.Set(id, defaultValue);
return defaultValue;
}

0 comments on commit 99f8326

Please sign in to comment.