From 97c7e4e3bf69acb077f08de0441bbfc8ab50988c Mon Sep 17 00:00:00 2001 From: "linuxgurugamer@gmail.com" Date: Sun, 21 Jan 2024 18:13:17 -0500 Subject: [PATCH] Changed rounding for radiatorEfficiency, batteryCharge, newCapacity to allow 2 decimal digits --- ChangeLog.txt | 3 +++ GameData/KRnD/KRnD.version | 4 ++-- GameData/KRnD/KRnD.version.1-12-3 | 26 ++++++++++++++++++++++++++ KRnD.version | 4 ++-- KRnD.version.1-12-3 | 26 ++++++++++++++++++++++++++ Source/AssemblyVersion.cs | 4 ++-- Source/KRnD.cs | 6 +++--- buildRelease.bat | 2 +- 8 files changed, 65 insertions(+), 10 deletions(-) create mode 100644 GameData/KRnD/KRnD.version.1-12-3 create mode 100644 KRnD.version.1-12-3 diff --git a/ChangeLog.txt b/ChangeLog.txt index bcd14d3..21f59a7 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,5 +1,8 @@ Changelog +1.16.0.14 + Changed rounding for radiatorEfficiency, batteryCharge, newCapacity to allow 2 decimal digits + 1.16.0.13 Thanks to @tgerland for providing a small update for the blacklist, to block Universal Storage 2 diff --git a/GameData/KRnD/KRnD.version b/GameData/KRnD/KRnD.version index c040c2b..fc02802 100644 --- a/GameData/KRnD/KRnD.version +++ b/GameData/KRnD/KRnD.version @@ -11,12 +11,12 @@ "MAJOR": 1, "MINOR": 16, "PATCH": 0, - "BUILD": 12 + "BUILD": 14 }, "KSP_VERSION": { "MAJOR": 1, "MINOR": 12, - "PATCH": 3 + "PATCH": 5 }, "KSP_VERSION_MIN": { "MAJOR": 1, diff --git a/GameData/KRnD/KRnD.version.1-12-3 b/GameData/KRnD/KRnD.version.1-12-3 new file mode 100644 index 0000000..c040c2b --- /dev/null +++ b/GameData/KRnD/KRnD.version.1-12-3 @@ -0,0 +1,26 @@ +{ + "NAME": "KRnD", + "URL": "https://raw.githubusercontent.com/linuxgurugamer/KRnD/master/KRnD.version", + "CHANGE_LOG_URL": "https://raw.githubusercontent.com/linuxgurugamer/KRnD/master/README.md", + "DOWNLOAD": "https://github.com/linuxgurugamer/KRnD/releases", + "GITHUB": { + "USERNAME": "linuxgurugamer", + "REPOSITORY": "KRnD" + }, + "VERSION": { + "MAJOR": 1, + "MINOR": 16, + "PATCH": 0, + "BUILD": 12 + }, + "KSP_VERSION": { + "MAJOR": 1, + "MINOR": 12, + "PATCH": 3 + }, + "KSP_VERSION_MIN": { + "MAJOR": 1, + "MINOR": 12, + "PATCH": 0 + } +} diff --git a/KRnD.version b/KRnD.version index e1850ec..fc02802 100644 --- a/KRnD.version +++ b/KRnD.version @@ -11,12 +11,12 @@ "MAJOR": 1, "MINOR": 16, "PATCH": 0, - "BUILD": 13 + "BUILD": 14 }, "KSP_VERSION": { "MAJOR": 1, "MINOR": 12, - "PATCH": 3 + "PATCH": 5 }, "KSP_VERSION_MIN": { "MAJOR": 1, diff --git a/KRnD.version.1-12-3 b/KRnD.version.1-12-3 new file mode 100644 index 0000000..e1850ec --- /dev/null +++ b/KRnD.version.1-12-3 @@ -0,0 +1,26 @@ +{ + "NAME": "KRnD", + "URL": "https://raw.githubusercontent.com/linuxgurugamer/KRnD/master/KRnD.version", + "CHANGE_LOG_URL": "https://raw.githubusercontent.com/linuxgurugamer/KRnD/master/README.md", + "DOWNLOAD": "https://github.com/linuxgurugamer/KRnD/releases", + "GITHUB": { + "USERNAME": "linuxgurugamer", + "REPOSITORY": "KRnD" + }, + "VERSION": { + "MAJOR": 1, + "MINOR": 16, + "PATCH": 0, + "BUILD": 13 + }, + "KSP_VERSION": { + "MAJOR": 1, + "MINOR": 12, + "PATCH": 3 + }, + "KSP_VERSION_MIN": { + "MAJOR": 1, + "MINOR": 12, + "PATCH": 0 + } +} diff --git a/Source/AssemblyVersion.cs b/Source/AssemblyVersion.cs index a91e110..e85d433 100644 --- a/Source/AssemblyVersion.cs +++ b/Source/AssemblyVersion.cs @@ -5,5 +5,5 @@ using System.Reflection; - [assembly: AssemblyVersion("1.16.0.12")] - [assembly: AssemblyFileVersion("1.16.0.12")] + [assembly: AssemblyVersion("1.16.0.14")] + [assembly: AssemblyFileVersion("1.16.0.14")] diff --git a/Source/KRnD.cs b/Source/KRnD.cs index 105ea01..eb5b303 100644 --- a/Source/KRnD.cs +++ b/Source/KRnD.cs @@ -725,7 +725,7 @@ public static void updatePart(Part part, KRnDUpgrade upgradesToApply) { rndModule.radiatorEfficiency_upgrades = upgradesToApply.radiatorEfficiency; double radiatorEfficiency = originalStats.radiatorEfficiency * (1 + KRnD.calculateImprovementFactor(rndModule.radiatorEfficiency_improvement, rndModule.radiatorEfficiency_improvementScale, upgradesToApply.radiatorEfficiency)); - radiatorEfficiency = Math.Round(radiatorEfficiency);// Don't want decimals + radiatorEfficiency = Math.Round(radiatorEfficiency, 2);// Allow 2 decimals activeRadiator.maxEnergyTransfer = radiatorEfficiency; } else @@ -769,7 +769,7 @@ public static void updatePart(Part part, KRnDUpgrade upgradesToApply) { rndModule.batteryCharge_upgrades = upgradesToApply.batteryCharge; double batteryCharge = originalStats.batteryCharge * (1 + KRnD.calculateImprovementFactor(rndModule.batteryCharge_improvement, rndModule.batteryCharge_improvementScale, upgradesToApply.batteryCharge)); - batteryCharge = Math.Round(batteryCharge); // We don't want half units of electric charge + batteryCharge = Math.Round(batteryCharge, 2);// Allow 2 decimals bool batteryIsFull = false; if (electricCharge.amount == electricCharge.maxAmount) batteryIsFull = true; @@ -867,7 +867,7 @@ public static void updatePart(Part part, KRnDUpgrade upgradesToApply) if (!originalStats.fuelCapacities.ContainsKey(fuelResource.resourceName)) continue; double originalCapacity = originalStats.fuelCapacities[fuelResource.resourceName]; double newCapacity = originalCapacity * improvementFactor; - newCapacity = Math.Round(newCapacity); // We don't want half units of fuel + newCapacity = Math.Round(newCapacity, 2);// Allow 2 decimals bool tankIsFull = false; if (fuelResource.amount == fuelResource.maxAmount) tankIsFull = true; diff --git a/buildRelease.bat b/buildRelease.bat index 3eb6e73..d66a9a9 100644 --- a/buildRelease.bat +++ b/buildRelease.bat @@ -26,7 +26,7 @@ rem README is the readme file set GAMEDIR=KRnD set GAMEDATA="GameData\" set VERSIONFILE=%GAMEDIR%.version -set LICENSE=License.txt +set LICENSE= set README=ReadMe.md set RELEASEDIR=d:\Users\jbb\release