Skip to content

Commit

Permalink
Prepare for Release 1.20.2 (#79)
Browse files Browse the repository at this point in the history
* Fix DoubleCurve transpiler. Transpilers are not my friend.

* Update KSPCommunityFixes.version

* Update AssemblyInfo.cs

* Update README.md
  • Loading branch information
NathanKell authored Aug 6, 2022
1 parent 21306a3 commit 2a7c140
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion GameData/KSPCommunityFixes/KSPCommunityFixes.version
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"NAME": "KSPCommunityFixes",
"URL": "https://raw.githubusercontent.com/KSPModdingLibs/KSPCommunityFixes/master/GameData/KSPCommunityFixes/KSPCommunityFixes.version",
"DOWNLOAD": "https://github.com/KSPModdingLibs/KSPCommunityFixes/releases",
"VERSION": {"MAJOR": 1, "MINOR": 20, "PATCH": 1, "BUILD": 0},
"VERSION": {"MAJOR": 1, "MINOR": 20, "PATCH": 2, "BUILD": 0},
"KSP_VERSION": {"MAJOR": 1, "MINOR": 12, "PATCH": 3},
"KSP_VERSION_MIN": {"MAJOR": 1, "MINOR": 8, "PATCH": 0},
"KSP_VERSION_MAX": {"MAJOR": 1, "MINOR": 12, "PATCH": 3}
Expand Down
12 changes: 8 additions & 4 deletions KSPCommunityFixes/BugFixes/DoubleCurvePreserveTangents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,18 @@ static IEnumerable<CodeInstruction> DoubleCurve_RecomputeTangents_Transpiler(IEn
// The existing function has a test if ( count == 1 ) and, if true, it
// will flatten the tangents of the key regardless of if it is
// set to autotangent or not. Since the tangents of a single-key
// curve don't matter, let's just make the test always false,
// by making it if ( count == -1 ).
// curve don't matter, let's just return.
List<CodeInstruction> code = new List<CodeInstruction>(instructions);
for (int i = 1; i < code.Count; ++i)
{
if (code[i].opcode == OpCodes.Ldc_I4_1 && code[i - 1].opcode == OpCodes.Ldloc_1)
if (code[i].opcode == OpCodes.Ldc_I4_1 && code[i - 1].opcode != OpCodes.Ldloc_1)
{
code[i + 1] = new CodeInstruction(OpCodes.Ret);
code[i] = new CodeInstruction(OpCodes.Ret);
code[i + 1] = new CodeInstruction(OpCodes.Nop);
code[i + 2] = new CodeInstruction(OpCodes.Nop);
code[i + 3] = new CodeInstruction(OpCodes.Nop);
code[i + 4] = new CodeInstruction(OpCodes.Nop);
code[i + 5] = new CodeInstruction(OpCodes.Nop);
break;
}
}
Expand Down
4 changes: 2 additions & 2 deletions KSPCommunityFixes/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.20.1.0")]
[assembly: AssemblyFileVersion("1.20.1.0")]
[assembly: AssemblyVersion("1.20.2.0")]
[assembly: AssemblyFileVersion("1.20.2.0")]
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ If doing so in the `Debug` configuration and if your KSP install is modified to

### Changelog

##### 1.20.2
- Fix an issue with the DoubleCurve transpiler (contributed by @NathanKell, bug also contributed by @NathanKell)

##### 1.20.1
- Fix an issue with the DoubleCurve patch : [fix to DoubleCurvePreserveTangents](https://github.com/KSPModdingLibs/KSPCommunityFixes/pull/73) (contributed by @NathanKell)
- Fix a stock issue where PartModules added via code would have a null upgrades List : [extension to UpgradeBugs](https://github.com/KSPModdingLibs/KSPCommunityFixes/pull/74) (contributed by @NathanKell)
Expand Down

0 comments on commit 2a7c140

Please sign in to comment.