Skip to content

Commit

Permalink
Merge pull request #12 from R-T-B/FixAtmoTemps
Browse files Browse the repository at this point in the history
This fixes issue #3 for good.  Should have no consequences either.
  • Loading branch information
prestja committed Jul 6, 2020
2 parents 75f09cc + a3e2655 commit 84fe61c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Kopernicus/Components/KopernicusStar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,9 @@ public Double CalculateFluxAt(Vessel vessel)
Ray ray = new Ray(ScaledSpace.LocalToScaledSpace(integratorPosition), sunVector);

// Get Thermal Stats
if (vessel.mainBody.atmosphere && !vessel.mainBody.isStar)
if (vessel.mainBody.atmosphere)
{
if (sun == GetBodyReferencing(vessel.mainBody))
if (sun == GetBodyReferencing(vessel.mainBody) && !vessel.mainBody.isStar)
{
FlightIntegrator FI = vessel.GetComponent<FlightIntegrator>();
vessel.mainBody.GetAtmoThermalStats(true, sun, sunVector, Vector3d.Dot(sunVector, vessel.upAxis), vessel.upAxis, vessel.altitude, out FI.atmosphereTemperatureOffset, out FI.bodyEmissiveFlux, out FI.bodyAlbedoFlux);
Expand Down Expand Up @@ -358,7 +358,7 @@ public static void SunBodyFlux(ModularFlightIntegrator MFI)
/// </summary>
public static CelestialBody GetBodyReferencing(CelestialBody body)
{
while (body?.orbit?.referenceBody != null && !body.orbit.referenceBody.isStar)
while (body?.orbit?.referenceBody != null)
{
body = body.orbit.referenceBody;
}
Expand Down

0 comments on commit 84fe61c

Please sign in to comment.