diff --git a/GameData/SystemHeat/Plugin/SystemHeat.dll b/GameData/SystemHeat/Plugin/SystemHeat.dll index 7b14521..f3711e8 100644 Binary files a/GameData/SystemHeat/Plugin/SystemHeat.dll and b/GameData/SystemHeat/Plugin/SystemHeat.dll differ diff --git a/GameData/SystemHeat/Versioning/SystemHeat.version b/GameData/SystemHeat/Versioning/SystemHeat.version index f904c72..b5c30b7 100644 --- a/GameData/SystemHeat/Versioning/SystemHeat.version +++ b/GameData/SystemHeat/Versioning/SystemHeat.version @@ -6,7 +6,7 @@ { "MAJOR":0, "MINOR":7, - "PATCH":0, + "PATCH":1, "BUILD":0 }, "KSP_VERSION": diff --git a/SystemHeat/SystemHeat/Modules/BoiloffFuel.cs b/SystemHeat/SystemHeat/Modules/BoiloffFuel.cs index 615bb5a..787ec96 100644 --- a/SystemHeat/SystemHeat/Modules/BoiloffFuel.cs +++ b/SystemHeat/SystemHeat/Modules/BoiloffFuel.cs @@ -141,8 +141,19 @@ public void Boiloff(double seconds, double scale) if (fuelPresent) { double toBoil = resource.amount * (1.0 - Math.Pow(1.0 - boiloffRateSeconds, seconds)) * scale; - - double boilResult = part.RequestResource(resource.info.id, toBoil, ResourceFlowMode.NO_FLOW); + double boilResult; + /// If you're reading this, stop now + if (!resource.flowState) + { + /// This handles if the flow has been disabled in the UI. we gotta ignore it, in the best way possible + resource.flowState = true; + boilResult = part.RequestResource(resource.info.id, toBoil, ResourceFlowMode.NO_FLOW); + resource.flowState = false; + } + else + { + boilResult = part.RequestResource(resource.info.id, toBoil, ResourceFlowMode.NO_FLOW); + } /// Generate outputs if (outputs.Count > 0) diff --git a/SystemHeat/SystemHeat/UI/ToolbarUI/ToolbarIconTag.cs b/SystemHeat/SystemHeat/UI/ToolbarUI/ToolbarIconTag.cs index d8ad8de..f17362b 100644 --- a/SystemHeat/SystemHeat/UI/ToolbarUI/ToolbarIconTag.cs +++ b/SystemHeat/SystemHeat/UI/ToolbarUI/ToolbarIconTag.cs @@ -19,26 +19,29 @@ public class ToolbarIconTag public ToolbarIconTag() { } public void Position(ApplicationLauncherButton button) { - alertToolbarBackgroundRect.SetParent(button.toggleButton.transform, false); - alertToolbarBackgroundRect.anchorMin = Vector2.zero; - alertToolbarBackgroundRect.anchorMax = Vector3.one; - alertToolbarBackgroundRect.pivot = Vector2.zero; - alertToolbarBackgroundRect.offsetMin = new Vector2(22, 20); - alertToolbarBackgroundRect.offsetMax = new Vector2(0, 0); + if (button != null) + { + alertToolbarBackgroundRect.SetParent(button.toggleButton.transform, false); + alertToolbarBackgroundRect.anchorMin = Vector2.zero; + alertToolbarBackgroundRect.anchorMax = Vector3.one; + alertToolbarBackgroundRect.pivot = Vector2.zero; + alertToolbarBackgroundRect.offsetMin = new Vector2(22, 20); + alertToolbarBackgroundRect.offsetMax = new Vector2(0, 0); - alertToolbarGlowRect.SetParent(alertToolbarBackgroundRect.transform, false); - alertToolbarGlowRect.anchorMin = Vector2.zero; - alertToolbarGlowRect.anchorMax = Vector3.one; - alertToolbarGlowRect.pivot = Vector2.one * 0.5f; - alertToolbarGlowRect.offsetMin = new Vector2(-5, -5); - alertToolbarGlowRect.offsetMax = new Vector2(5, 5); + alertToolbarGlowRect.SetParent(alertToolbarBackgroundRect.transform, false); + alertToolbarGlowRect.anchorMin = Vector2.zero; + alertToolbarGlowRect.anchorMax = Vector3.one; + alertToolbarGlowRect.pivot = Vector2.one * 0.5f; + alertToolbarGlowRect.offsetMin = new Vector2(-5, -5); + alertToolbarGlowRect.offsetMax = new Vector2(5, 5); - alertToolbarRect.SetParent(alertToolbarBackgroundRect.transform, false); - alertToolbarRect.anchorMin = Vector2.zero; - alertToolbarRect.anchorMax = Vector3.one; - alertToolbarRect.pivot = Vector2.zero; - alertToolbarRect.offsetMin = new Vector2(0, 0); - alertToolbarRect.offsetMax = new Vector2(0, 0); + alertToolbarRect.SetParent(alertToolbarBackgroundRect.transform, false); + alertToolbarRect.anchorMin = Vector2.zero; + alertToolbarRect.anchorMax = Vector3.one; + alertToolbarRect.pivot = Vector2.zero; + alertToolbarRect.offsetMin = new Vector2(0, 0); + alertToolbarRect.offsetMax = new Vector2(0, 0); + } } public void Initialize() { diff --git a/changelog.txt b/changelog.txt index 874e5a7..a5ab3de 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,8 @@ +v0.7.1 +------ +- Fix a null reference exception when loading a vessel with no SystemHeat parts +- Fixed an issue where a player could disable a tank in the UI, thus disabling boiloff + v0.7.0 ------ - Updated ModuleManager to 4.2.3 diff --git a/readme.txt b/readme.txt index 0c6f91d..295ee1e 100644 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,5 @@ ================ -SystemHeat 0.7.0 +SystemHeat 0.7.1 ================ 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.