Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: KSP-RO/RP-1
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c0d3c75f7b27
Choose a base ref
...
head repository: KSP-RO/RP-1
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d7dfec5dc2e6
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Jan 19, 2019

  1. Fix (?) non-reentry rated.

    NathanKell committed Jan 19, 2019
    Copy the full SHA
    fd96264 View commit details
  2. Add ModuleNoEVA.

    NathanKell committed Jan 19, 2019
    Copy the full SHA
    d7dfec5 View commit details
Showing with 56 additions and 0 deletions.
  1. +51 −0 Source/ModuleNoEVA.cs
  2. +5 −0 Source/ModuleNonReentryRated.cs
51 changes: 51 additions & 0 deletions Source/ModuleNoEVA.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Text;
using UnityEngine;
using KSP;

namespace RP0
{
public class ModuleNoEVA : PartModule
{
protected List<Collider> airlocks = new List<Collider>();
public override string GetInfo()
{
return "Cannot EVA from this part. Can still exit when landed on Earth or flying at low (20km) altitude.";
}

public override void OnAwake()
{
base.OnAwake();

airlocks.Clear();

foreach (var c in part.GetComponentsInChildren<Collider>())
if (c.gameObject.tag == "Airlock")
airlocks.Add(c);
}

protected void FixedUpdate()
{
bool evaOK = vessel.mainBody == Planetarium.fetch.Home &&
(vessel.situation == Vessel.Situations.LANDED
|| vessel.situation == Vessel.Situations.PRELAUNCH
|| vessel.situation == Vessel.Situations.SPLASHED
|| (vessel.situation == Vessel.Situations.FLYING && vessel.altitude < 20000));

foreach (var c in airlocks)
{
if (evaOK)
{
if (c.gameObject.tag != "Airlock")
c.gameObject.tag = "Airlock";
}
else
{
if (c.gameObject.tag == "Airlock")
c.gameObject.tag = "Untagged";
}
}
}
}
}
5 changes: 5 additions & 0 deletions Source/ModuleNonReentryRated.cs
Original file line number Diff line number Diff line change
@@ -39,8 +39,13 @@ public static void UpdateThermodynamicsPre(ModularFI.ModularFlightIntegrator fi)
PartThermalData ptd = fi.partThermalDataList[i];
if (ptd.part.maximum_drag == float.MinValue)
{
var part = ptd.part;

ptd.convectionTempMultiplier = Math.Max(ptd.convectionTempMultiplier, 0.5d);
ptd.convectionCoeffMultiplier = Math.Max(ptd.convectionCoeffMultiplier, 0.5d);

ptd.postShockExtTemp = UtilMath.LerpUnclamped(part.vessel.atmosphericTemperature, part.vessel.externalTemperature, ptd.convectionTempMultiplier);
ptd.finalCoeff = part.vessel.convectiveCoefficient * ptd.convectionArea * 0.001d * part.heatConvectiveConstant * ptd.convectionCoeffMultiplier;
}
}
}