Skip to content

Commit

Permalink
Merge pull request #235 from DMagic1/release
Browse files Browse the repository at this point in the history
Version 16.6
  • Loading branch information
DMagic1 authored Aug 18, 2016
2 parents e1b5104 + f71ebf1 commit dc84749
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 19 deletions.
2 changes: 1 addition & 1 deletion SCANassets/SCANsat.version
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"MAJOR":1,
"MINOR":1,
"PATCH":6,
"BUILD":5
"BUILD":6
},
"KSP_VERSION":{
"MAJOR":1,
Expand Down
6 changes: 3 additions & 3 deletions SCANmechjeb/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
// 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("1.6.0.5")]
[assembly: AssemblyFileVersion("1.6.0.5")]
[assembly: AssemblyInformationalVersion ("v16.5")]
[assembly: AssemblyVersion("1.6.0.6")]
[assembly: AssemblyFileVersion("1.6.0.6")]
[assembly: AssemblyInformationalVersion ("v16.6")]

[assembly: KSPAssembly ("SCANmechjeb", 0, 4)]
[assembly: KSPAssemblyDependency ("SCANsat", 1, 6)]
Expand Down
5 changes: 5 additions & 0 deletions SCANsat/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Version 16.6 - 2016-8-18
-----------------------

- Fix compatibility with Kerbalism

Version 16.5 - 2016-8-10
------------------------

Expand Down
6 changes: 3 additions & 3 deletions SCANsat/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion ("1.6.0.5")]
[assembly: AssemblyFileVersion ("1.6.0.5")]
[assembly: AssemblyInformationalVersion ("v16.5")]
[assembly: AssemblyVersion ("1.6.0.6")]
[assembly: AssemblyFileVersion ("1.6.0.6")]
[assembly: AssemblyInformationalVersion ("v16.6")]

[assembly: KSPAssembly ("SCANsat", 1, 6)]

Expand Down
68 changes: 56 additions & 12 deletions SCANsat/SCANutil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,21 +200,47 @@ public static bool registerSensorExternal(Vessel v, ProtoPartModuleSnapshot m, P
if (prefab == null)
return false;

if (!(prefab.Modules.Contains<SCANsat.SCAN_PartModules.SCANsat>() || prefab.Modules.Contains<ModuleSCANresourceScanner>()))
if (!(m.moduleName == "SCANsat" || m.moduleName == "ModuleSCANresourceScanner"))
return false;

if (!(m.moduleName == "SCANsat" || m.moduleName == "ModuleSCANresourceScanner"))
int sensor = 0;
double fov = 0;
double min = 0;
double max = 0;
double best = 0;

if (prefab.Modules.Contains<SCANsat.SCAN_PartModules.SCANsat>())
{
SCANsat.SCAN_PartModules.SCANsat scan = prefab.Modules.GetModule<SCANsat.SCAN_PartModules.SCANsat>();

if (scan == null)
return false;

sensor = scan.sensorType;
fov = scan.fov;
min = scan.min_alt;
max = scan.max_alt;
best = scan.best_alt;
}
else if (prefab.Modules.Contains<ModuleSCANresourceScanner>())
{
SCANsat.SCAN_PartModules.ModuleSCANresourceScanner scan = prefab.Modules.GetModule<SCANsat.SCAN_PartModules.ModuleSCANresourceScanner>();

if (scan == null)
return false;

sensor = scan.sensorType;
fov = scan.fov;
min = scan.min_alt;
max = scan.max_alt;
best = scan.best_alt;
}
else
return false;

if (SCANcontroller.controller == null)
return false;

int sensor = prefab.Fields.GetValue<int>("sensorType");
double fov = prefab.Fields.GetValue<double>("fov");
double min = prefab.Fields.GetValue<double>("min_alt");
double max = prefab.Fields.GetValue<double>("max_alt");
double best = prefab.Fields.GetValue<double>("best_alt");

SCANcontroller.controller.registerSensor(v, (SCANtype)sensor, fov, min, max, best);

m.moduleValues.SetValue("scanning", true.ToString());
Expand All @@ -240,17 +266,35 @@ public static bool unregisterSensorExternal(Vessel v, ProtoPartModuleSnapshot m,
if (prefab == null)
return false;

if (!(prefab.Modules.Contains<SCANsat.SCAN_PartModules.SCANsat>() || prefab.Modules.Contains<ModuleSCANresourceScanner>()))
if (!(m.moduleName == "SCANsat" || m.moduleName == "ModuleSCANresourceScanner"))
return false;

if (!(m.moduleName == "SCANsat" || m.moduleName == "ModuleSCANresourceScanner"))
int sensor = 0;

if (prefab.Modules.Contains<SCANsat.SCAN_PartModules.SCANsat>())
{
SCANsat.SCAN_PartModules.SCANsat scan = prefab.Modules.GetModule<SCANsat.SCAN_PartModules.SCANsat>();

if (scan == null)
return false;

sensor = scan.sensorType;
}
else if (prefab.Modules.Contains<ModuleSCANresourceScanner>())
{
SCANsat.SCAN_PartModules.ModuleSCANresourceScanner scan = prefab.Modules.GetModule<SCANsat.SCAN_PartModules.ModuleSCANresourceScanner>();

if (scan == null)
return false;

sensor = scan.sensorType;
}
else
return false;

if (SCANcontroller.controller == null)
return false;

int sensor = prefab.Fields.GetValue<int>("sensorType");

SCANcontroller.controller.unregisterSensor(v, (SCANtype)sensor);

m.moduleValues.SetValue("scanning", false.ToString());
Expand Down

0 comments on commit dc84749

Please sign in to comment.