Skip to content

Commit

Permalink
Try to fix solar panel stuff
Browse files Browse the repository at this point in the history
Dorian Stoll committed Apr 29, 2017
1 parent 92c5355 commit 066bd10
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Kopernicus/Kopernicus/RuntimeUtility/StarLightSwitcher.cs
Original file line number Diff line number Diff line change
@@ -72,21 +72,25 @@ public void SetAsActive()
// SolarPanels
foreach (ModuleDeployableSolarPanel sp in FlightGlobals.ActiveVessel.FindPartModulesImplementing<ModuleDeployableSolarPanel>())
{
sp.trackingBody = celestialBody;
sp.trackingTransformLocal = celestialBody.transform;
if (celestialBody.scaledBody)
{
sp.trackingTransformScaled = celestialBody.scaledBody.transform;
}
sp.GetTrackingBodyTransforms();
}

// Radiators
foreach (ModuleDeployableRadiator rad in FlightGlobals.ActiveVessel.FindPartModulesImplementing<ModuleDeployableRadiator>())
{
rad.trackingBody = celestialBody;
rad.trackingTransformLocal = celestialBody.transform;
if (celestialBody.scaledBody)
{
rad.trackingTransformScaled = celestialBody.scaledBody.transform;
}
rad.GetTrackingBodyTransforms();
}
}

@@ -136,7 +140,7 @@ void Start()
Logger.Default.Flush ();

// GameScenes
GameEvents.onLevelWasLoaded.Add(scene => HomeStar().SetAsActive());
GameEvents.onLevelWasLoadedGUIReady.Add(scene => HomeStar().SetAsActive());
}

void Update()

0 comments on commit 066bd10

Please sign in to comment.