Skip to content

Commit

Permalink
Merge pull request #118 from post-kerbin-mining-corporation/dev
Browse files Browse the repository at this point in the history
Release 0.7.3
  • Loading branch information
ChrisAdderley authored Aug 22, 2024
2 parents 3501309 + 1606867 commit d2ee287
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 11 deletions.
Binary file modified GameData/SystemHeat/Plugin/SystemHeat.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion GameData/SystemHeat/Versioning/SystemHeat.version
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
"MAJOR":0,
"MINOR":7,
"PATCH":2,
"PATCH":3,
"BUILD":0
},
"KSP_VERSION":
Expand Down
11 changes: 7 additions & 4 deletions SystemHeat/SystemHeat/Modules/ModuleSystemHeatFissionReactor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ public void DoCatchup()
if (elapsedTime > 0d)
{
Utils.Log($"[SystemHeatFissionReactor] Catching up {elapsedTime} s of time on load", LogType.Modules);
float fuelThrottle = CurrentReactorThrottle / 100f;
double fuelThrottle = CurrentReactorThrottle / 100f;

foreach (ResourceRatio ratio in inputs)
{
Expand Down Expand Up @@ -818,7 +818,7 @@ private void HandleResourceActivities(float timeStep)

fuelCheckPassed = true;
burnRate = 0d;
float fuelThrottle = CurrentReactorThrottle / 100f;
double fuelThrottle = CurrentReactorThrottle / 100f;

// Check for full-ness
foreach (ResourceRatio ratio in outputs)
Expand All @@ -834,7 +834,7 @@ private void HandleResourceActivities(float timeStep)
// Check for fuel and consume
foreach (ResourceRatio ratio in inputs)
{
double amt = this.part.RequestResource(ratio.ResourceName, fuelThrottle * ratio.Ratio * timeStep, ratio.FlowMode);
double amt = this.part.RequestResource(ratio.ResourceName, fuelThrottle * ratio.Ratio * (double)timeStep, ratio.FlowMode);

if (MinimumThrottle > 0)
{
Expand All @@ -858,7 +858,10 @@ private void HandleResourceActivities(float timeStep)
}
}
if (ratio.ResourceName == FuelName)
{
burnRate = fuelThrottle * ratio.Ratio;
Debug.Log($"Fuels: {fuelThrottle:E5}, {ratio.Ratio:E5}, {burnRate:E5}");
}
}
// If fuel consumed, add waste
if (fuelCheckPassed)
Expand Down Expand Up @@ -981,7 +984,7 @@ public void DoReactorRepair()
// Finds time remaining at specified fuel burn rates
public string FindTimeRemaining(double amount, double rate)
{
if (rate < 0.0000001)
if (rate < 1E-15)
{
return Localizer.Format("#LOC_SystemHeat_ModuleSystemHeatFissionReactor_Field_FuelStatus_VeryLong");
}
Expand Down
2 changes: 1 addition & 1 deletion SystemHeat/SystemHeat/Modules/ModuleSystemHeatRadiator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public override void FixedUpdate()

if (HighLogic.LoadedSceneIsEditor)
{
if (base.IsCooling || base._depRad.deployState == ModuleDeployablePart.DeployState.EXTENDED)
if (base.IsCooling || ((base._depRad != null) && (base._depRad.deployState == ModuleDeployablePart.DeployState.EXTENDED)))
{
radiativeFlux = -temperatureCurve.Evaluate(heatModule.LoopTemperature);
convectiveFlux = 0f;
Expand Down
6 changes: 3 additions & 3 deletions SystemHeat/SystemHeat/UI/ToolbarUI/ToolbarSituation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ public void Initialize(Transform root)
if (HighLogic.LoadedSceneIsEditor)
{
currentBody = FlightGlobals.GetHomeBody();
bodyDopdown.AddOptions(FlightGlobals.Bodies.Select(x => x.name).ToList());
bodyDopdown.AddOptions(FlightGlobals.Bodies.Select(x => x.bodyDisplayName.LocalizeRemoveGender()).ToList());
for (int i = 0; i < bodyDopdown.options.Count; i++)
{
if (bodyDopdown.options[i].text == currentBody.name)
if (bodyDopdown.options[i].text == currentBody.bodyDisplayName.LocalizeRemoveGender())
bodyDopdown.SetValueWithoutNotify(i);
}

Expand Down Expand Up @@ -189,7 +189,7 @@ public void OnBodyDropdownChange()
Utils.Log($"[ToolbarPanel]: Selected body {bodyDopdown.options[bodyDopdown.value].text}", LogType.UI);
foreach (CelestialBody body in FlightGlobals.Bodies)
{
if (body.name == bodyDopdown.options[bodyDopdown.value].text)
if (body.bodyDisplayName.LocalizeRemoveGender() == bodyDopdown.options[bodyDopdown.value].text)
{
currentBody = body;
SetBody(currentBody);
Expand Down
8 changes: 7 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
v0.7.1
v0.7.3
------
- Fixed an issue where static radiators would create exceptions in the editor
- Allowed lower resource flow rates for fission reactors to work correctly and show in the UI
- Situation checklist dropdown in the Toolbar UI now uses BodyDisplayName instead of internal name

v0.7.2
------
- Fixed the coolant tank being renamed for no particular reason (ghosts??)

Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
================
SystemHeat 0.7.2
SystemHeat 0.7.3
================

A mod for Kerbal Space Program, intended to provide a better experience for heat management, particularly geared towards resource extraction, high energy engines, and nuclear reactors.
Expand Down

0 comments on commit d2ee287

Please sign in to comment.