diff --git a/GameData/ThunderAerospace/ChangeLog.txt b/GameData/ThunderAerospace/ChangeLog.txt index 74c335c..71b9923 100644 --- a/GameData/ThunderAerospace/ChangeLog.txt +++ b/GameData/ThunderAerospace/ChangeLog.txt @@ -1,3 +1,7 @@ +v0.13.0 + Fix Rescue kerbal for kerbals on the ground due to contracts system not being loaded in time. + Change Water purifier Water output rate to match water usage rates so as to avoid positive water scenario. + Fix issue with Low Electricity Warning at high warp rate. v0.12.9 Fix Rescue kerbal checking where contract only contains kerbal's first name. Fix when Rescue contracts cancelled. Untrack Kerbals on Rescue contracts if the contract is cancelled. diff --git a/GameData/ThunderAerospace/TacLifeSupport/TacLifeSupport.version b/GameData/ThunderAerospace/TacLifeSupport/TacLifeSupport.version index c4c598e..ed06291 100644 --- a/GameData/ThunderAerospace/TacLifeSupport/TacLifeSupport.version +++ b/GameData/ThunderAerospace/TacLifeSupport/TacLifeSupport.version @@ -3,7 +3,7 @@ "URL": "http://ksp-avc.cybutek.net/version.php?id=9", "DOWNLOAD": "https://github.com/KSP-RO/TacLifeSupport/releases", "CHANGE_LOG_URL": "https://github.com/KSP-RO/TacLifeSupport/wiki/Changes", - "VERSION": "0.12.9.0", + "VERSION": "0.13.0.0", "KSP_VERSION": { "MAJOR": 1, "MINOR": 2, diff --git a/GameData/ThunderAerospace/TacLifeSupportRecyclers/Recycler_WaterPurifier.cfg b/GameData/ThunderAerospace/TacLifeSupportRecyclers/Recycler_WaterPurifier.cfg index 4ddfe95..8c19056 100644 --- a/GameData/ThunderAerospace/TacLifeSupportRecyclers/Recycler_WaterPurifier.cfg +++ b/GameData/ThunderAerospace/TacLifeSupportRecyclers/Recycler_WaterPurifier.cfg @@ -97,7 +97,7 @@ PART OUTPUT_RESOURCE { ResourceName = Water - Ratio = 0.000012822916667 + Ratio = 0.000011188078704 DumpExcess = false } OUTPUT_RESOURCE diff --git a/GameData/ThunderAerospace/TacLifeSupportRecyclers/Recycler_WaterPurifierLarge.cfg b/GameData/ThunderAerospace/TacLifeSupportRecyclers/Recycler_WaterPurifierLarge.cfg index 57270c3..114da0f 100644 --- a/GameData/ThunderAerospace/TacLifeSupportRecyclers/Recycler_WaterPurifierLarge.cfg +++ b/GameData/ThunderAerospace/TacLifeSupportRecyclers/Recycler_WaterPurifierLarge.cfg @@ -98,7 +98,7 @@ PART OUTPUT_RESOURCE { ResourceName = Water - Ratio = 0.000012822916667 + Ratio = 0.000011188078704 DumpExcess = false } OUTPUT_RESOURCE diff --git a/GameData/ThunderAerospace/TacLifeSupportRecyclers/Recycler_WaterPurifierLarge375.cfg b/GameData/ThunderAerospace/TacLifeSupportRecyclers/Recycler_WaterPurifierLarge375.cfg index 4df7c5d..15acba9 100644 --- a/GameData/ThunderAerospace/TacLifeSupportRecyclers/Recycler_WaterPurifierLarge375.cfg +++ b/GameData/ThunderAerospace/TacLifeSupportRecyclers/Recycler_WaterPurifierLarge375.cfg @@ -98,7 +98,7 @@ PART OUTPUT_RESOURCE { ResourceName = Water - Ratio = 0.000012822916667 + Ratio = 0.000011188078704 DumpExcess = false } OUTPUT_RESOURCE diff --git a/GameData/ThunderAerospace/TacLifeSupport_v0.12.9.0.txt b/GameData/ThunderAerospace/TacLifeSupport_v0.12.9.0.txt deleted file mode 100644 index ab8d9f5..0000000 --- a/GameData/ThunderAerospace/TacLifeSupport_v0.12.9.0.txt +++ /dev/null @@ -1,3 +0,0 @@ -You have installed the TAC Life Support, version 0.12.9.0 ('062db9a'+'062db9a' with modifications). - -See the Readme.txt and LICENSE.txt files for more information. diff --git a/GameData/ThunderAerospace/TacLifeSupport_v0.13.0.0.txt b/GameData/ThunderAerospace/TacLifeSupport_v0.13.0.0.txt new file mode 100644 index 0000000..2652a33 --- /dev/null +++ b/GameData/ThunderAerospace/TacLifeSupport_v0.13.0.0.txt @@ -0,0 +1,3 @@ +You have installed the TAC Life Support, version 0.13.0.0 ('0a6f4e5'+'0a6f4e5' with modifications). + +See the Readme.txt and LICENSE.txt files for more information. diff --git a/Source/LifeSupportController.cs b/Source/LifeSupportController.cs index 86e98cd..430d8c0 100644 --- a/Source/LifeSupportController.cs +++ b/Source/LifeSupportController.cs @@ -27,6 +27,7 @@ */ using System; +using System.Collections; using System.Collections.Generic; using System.Linq; using Contracts.Templates; @@ -246,7 +247,7 @@ void FixedUpdate() int crewCapacity = UpdateVesselInfo(entry.Value, loadedvessel); if (crewCapacity == 0) { - checkDictionaries(); + StartCoroutine(checkDictionaries()); continue; } //If vessel is PRELAUNCH @@ -801,6 +802,7 @@ private void ConsumeElectricity(double currentTime, Vessel vessel, VesselInfo ve { double deltaTime = Math.Min(currentTime - vesselInfo.lastElectricity, Math.Max(globalsettings.ElectricityMaxDeltaTime, TimeWarp.fixedDeltaTime)); double desiredElectricity = rate * deltaTime; + vesselInfo.estimatedElectricityConsumptionRate = desiredElectricity; double electricityObtained, electricitySpace = 0; RSTUtils.Utilities.requireResourceID(vessel, globalsettings.ElectricityId, desiredElectricity, true, true, false, out electricityObtained, out electricitySpace); @@ -1270,8 +1272,7 @@ private void onLevelWasLoaded(GameScenes scene) { if (scene == GameScenes.FLIGHT && !checkedDictionaries) { - checkDictionaries(); - checkedDictionaries = true; + StartCoroutine(checkDictionaries()); } } @@ -1279,7 +1280,7 @@ private void onLevelWasLoaded(GameScenes scene) /// check the knownVessels and knownCrew dictionaries for entries that should be removed and remove them. /// Check all vessels in game that have crew and if we are not tracking them add them to vessel tracking. /// - private void checkDictionaries() + private IEnumerator checkDictionaries() { var vesselsToDelete = new List(); foreach (var vessel in gameSettings.knownVessels) @@ -1355,8 +1356,16 @@ private void checkDictionaries() VesselSortCountervslChgFlag = true; } } + //If Contracts system is active. Wait for it to finish loading contracts first. + if (Contracts.ContractSystem.Instance != null) + { + if (!Contracts.ContractSystem.loaded) + { + yield return null; + } + } //Check All Vessels, if they have crew and we are not tracking the vessel add it to tracking. - if (FlightGlobals.fetch) + if (FlightGlobals.fetch) { var allVessels = FlightGlobals.Vessels; for (int i = 0; i < allVessels.Count; ++i) @@ -1367,6 +1376,7 @@ private void checkDictionaries() } } } + checkedDictionaries = true; } /// diff --git a/Source/Properties/AssemblyInfo.cs b/Source/Properties/AssemblyInfo.cs index a156b5a..4d894f5 100644 --- a/Source/Properties/AssemblyInfo.cs +++ b/Source/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.12.9")] -[assembly: AssemblyFileVersion("0.12.9")] +[assembly: AssemblyVersion("0.13.0")] +[assembly: AssemblyFileVersion("0.13.0")] diff --git a/Source/TacLifeSupport.csproj b/Source/TacLifeSupport.csproj index 8433719..bffa818 100644 --- a/Source/TacLifeSupport.csproj +++ b/Source/TacLifeSupport.csproj @@ -107,8 +107,8 @@ 0 - 12 - 9 + 13 + 0 $(AssemblyMajorVersion) $(AssemblyMinorVersion) $(AssemblyBuildNumber)