diff --git a/src/Kopernicus/Components/KopernicusStar.cs b/src/Kopernicus/Components/KopernicusStar.cs index 14be9f9f8..89c56e2db 100755 --- a/src/Kopernicus/Components/KopernicusStar.cs +++ b/src/Kopernicus/Components/KopernicusStar.cs @@ -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(); vessel.mainBody.GetAtmoThermalStats(true, sun, sunVector, Vector3d.Dot(sunVector, vessel.upAxis), vessel.upAxis, vessel.altitude, out FI.atmosphereTemperatureOffset, out FI.bodyEmissiveFlux, out FI.bodyAlbedoFlux); @@ -358,7 +358,7 @@ public static void SunBodyFlux(ModularFlightIntegrator MFI) /// public static CelestialBody GetBodyReferencing(CelestialBody body) { - while (body?.orbit?.referenceBody != null && !body.orbit.referenceBody.isStar) + while (body?.orbit?.referenceBody != null) { body = body.orbit.referenceBody; }