Skip to content

Commit

Permalink
Fixed #2: AutostageLimit property wasn't saved properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Genhis committed May 11, 2019
1 parent fed657c commit 8ae4bd2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [0.4.1] - 2019-05-11
### Fixed
- `AutostageLimit` property of StageController not being saved properly
([#2](https://github.com/Genhis/KRPC.MechJeb/issues/2))

## [0.4.0] - 2019-03-31
### Added
- Auto-hotstaging support in StageController
Expand Down Expand Up @@ -84,7 +89,8 @@ proximity or reverting a flight to launch
- **StagingController**
- **TargetController** to get information about the current target

[Unreleased]: https://github.com/Genhis/KRPC.MechJeb/compare/v0.4.0...HEAD
[Unreleased]: https://github.com/Genhis/KRPC.MechJeb/compare/v0.4.1...HEAD
[0.4.1]: https://github.com/Genhis/KRPC.MechJeb/compare/v0.4.0...v0.4.1
[0.4.0]: https://github.com/Genhis/KRPC.MechJeb/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/Genhis/KRPC.MechJeb/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/Genhis/KRPC.MechJeb/compare/v0.1.0...v0.2.0
Expand Down
3 changes: 3 additions & 0 deletions EditableVariables.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace KRPC.MechJeb {
public static class EditableVariables {
private static PropertyInfo editableDoubleVal;
private static FieldInfo editableIntVal;
private static FieldInfo editableIntText;

internal static bool InitTypes(Type t) {
switch(t.FullName) {
Expand All @@ -19,6 +20,7 @@ internal static bool InitTypes(Type t) {
return true;
case "MuMech.EditableInt":
editableIntVal = t.GetField("val");
editableIntText = t.GetField("_text");
return true;
default:
return false;
Expand All @@ -31,6 +33,7 @@ public static void SetDouble(object instance, double value) {

public static void SetInt(object instance, int value) {
editableIntVal.SetValue(instance, value);
editableIntText.SetValue(instance, value.ToString());
}

public static double GetDouble(object instance) {
Expand Down
6 changes: 3 additions & 3 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("KRPC.MechJeb")]
[assembly: AssemblyCopyright("© 2018 Genhis")]
[assembly: AssemblyCopyright("© 2018-2019 Genhis")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -31,5 +31,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.4.0")]
[assembly: AssemblyFileVersion("0.4.0")]
[assembly: AssemblyVersion("0.4.1")]
[assembly: AssemblyFileVersion("0.4.1")]

0 comments on commit 8ae4bd2

Please sign in to comment.