Skip to content

Commit

Permalink
Showing 3 changed files with 59 additions and 0 deletions.
51 changes: 51 additions & 0 deletions Source/ModuleNonReentryRated.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using KSP;

namespace RP0
{
public class ModuleNonReentryRated : PartModule
{
protected PartThermalData ptd;
protected bool recalc = true;

public override string GetInfo()
{
return "Part is not rated for reentry!";
}

public override void OnAwake()
{
base.OnAwake();
part.maximum_drag = float.MinValue;
}
}

[KSPAddon(KSPAddon.Startup.SpaceCentre, true)]
public class RP0ThermoChanger : MonoBehaviour
{
static CelestialBody body = null;
public void Start()
{
print("Registering RP-0 overrides with ModularFlightIntegrator");
ModularFI.ModularFlightIntegrator.RegisterUpdateThermodynamicsPre(UpdateThermodynamicsPre);
}

public static void UpdateThermodynamicsPre(ModularFI.ModularFlightIntegrator fi)
{
for (int i = fi.partThermalDataList.Count; i-- > 0;)
{
PartThermalData ptd = fi.partThermalDataList[i];
if (ptd.part.maximum_drag == float.MinValue)
{
ptd.convectionTempMultiplier = Math.Max(ptd.convectionTempMultiplier, 0.5d);
ptd.convectionTempMultiplier = Math.Max(ptd.convectionCoeffMultiplier, 0.5d);
}
}
}
}
}

3 changes: 3 additions & 0 deletions Source/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -34,3 +34,6 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.55.0.0")]
[assembly: AssemblyFileVersion("0.55.0.0")]

[assembly: KSPAssembly("RP-0", 0, 55)]
[assembly: KSPAssemblyDependency("ModularFlightIntegrator", 1, 0)]
5 changes: 5 additions & 0 deletions Source/RP0.csproj
Original file line number Diff line number Diff line change
@@ -58,6 +58,7 @@
<Compile Include="LoadingScreenChanger.cs" />
<Compile Include="DifficultyPresets.cs" />
<Compile Include="Maintenance\MaintenanceWindow.cs" />
<Compile Include="ModuleNonReentryRated.cs" />
<Compile Include="ModuleUnpressurizedCockpit.cs" />
<Compile Include="ModuleTag\DecreaseB.cs" />
<Compile Include="ModuleTag\EngineLiquidPF.cs" />
@@ -123,6 +124,10 @@
<HintPath>..\..\..\..\..\..\Games\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ModularFlightIntegrator">
<HintPath>..\..\..\..\..\..\Games\RO_122\GameData\ModularFlightIntegrator\ModularFlightIntegrator.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System">
<Private>False</Private>
</Reference>

0 comments on commit 6366ba4

Please sign in to comment.