Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

Commit

Permalink
Version 0.10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Real-Gecko committed Oct 13, 2016
1 parent bec52e2 commit d596c32
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 93 deletions.
21 changes: 10 additions & 11 deletions BonVoyage/BonVoyage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ public void Update()
rover.targetLatitude,
rover.targetLongitude
);

rover.distanceTravelled += deltaS;
if (rover.distanceTravelled >= rover.distanceToTarget)
{
Expand Down Expand Up @@ -233,27 +232,27 @@ public void Update()
rover.status = "idle";
}
else {
int steps = Convert.ToInt32(Math.Floor(rover.distanceTravelled / 1000));
int step = Convert.ToInt32(Math.Floor(rover.distanceTravelled / 1000));
double remainder = rover.distanceTravelled % 1000;

if (steps < rover.path.Count)
if (step < rover.path.Count - 1)
bearing = GeoUtils.InitialBearing(
rover.path[steps].latitude,
rover.path[steps].longitude,
rover.path[steps + 1].latitude,
rover.path[steps + 1].longitude
rover.path[step].latitude,
rover.path[step].longitude,
rover.path[step + 1].latitude,
rover.path[step + 1].longitude
);
else
bearing = GeoUtils.InitialBearing(
rover.path[steps].latitude,
rover.path[steps].longitude,
rover.path[step].latitude,
rover.path[step].longitude,
rover.targetLatitude,
rover.targetLongitude
);

double[] newCoordinates = GeoUtils.GetLatitudeLongitude(
rover.path[steps].latitude,
rover.path[steps].longitude,
rover.path[step].latitude,
rover.path[step].longitude,
bearing,
remainder,
rover.vessel.mainBody.Radius
Expand Down
134 changes: 67 additions & 67 deletions BonVoyage/BonVoyage.csproj
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{05CFDB95-994A-4C5D-9840-C6D1A86918C2}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>BonVoyage</RootNamespace>
<AssemblyName>BonVoyage</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<CustomCommands>
<CustomCommands>
<Command type="AfterBuild" command="${ProjectDir}\copy.bat" />
</CustomCommands>
</CustomCommands>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="Assembly-CSharp">
<HintPath>..\..\KSP\KSP_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="KSPUtil">
<HintPath>..\..\KSP\KSP_Data\Managed\KSPUtil.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>..\..\KSP\KSP_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\..\KSP\KSP_Data\Managed\UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>..\..\KSP\KSP_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="BonVoyage.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="GeoUtils.cs" />
<Compile Include="BonVoyageModule.cs" />
<Compile Include="ActiveRover.cs" />
<Compile Include="PathFinder\GridController.cs" />
<Compile Include="PathFinder\Hex.cs" />
<Compile Include="PathFinder\Path.cs" />
<Compile Include="PathFinder\PathFinder.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Folder Include="PathFinder\" />
</ItemGroup>
</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{05CFDB95-994A-4C5D-9840-C6D1A86918C2}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>BonVoyage</RootNamespace>
<AssemblyName>BonVoyage</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<CustomCommands>
<CustomCommands>
<Command>
<type>AfterBuild</type>
<command>${ProjectDir}\copy.bat</command>
</Command>
</CustomCommands>
</CustomCommands>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="Assembly-CSharp">
<HintPath>..\..\KSP\KSP_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>..\..\KSP\KSP_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>..\..\KSP\KSP_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\..\KSP\KSP_Data\Managed\UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="BonVoyage.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="GeoUtils.cs" />
<Compile Include="BonVoyageModule.cs" />
<Compile Include="ActiveRover.cs" />
<Compile Include="PathFinder\GridController.cs" />
<Compile Include="PathFinder\Hex.cs" />
<Compile Include="PathFinder\Path.cs" />
<Compile Include="PathFinder\PathFinder.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Folder Include="PathFinder\" />
</ItemGroup>
</Project>
16 changes: 10 additions & 6 deletions BonVoyage/BonVoyageModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void SetToActive()
}
}

[KSPEvent(guiActive = true, guiName = "Poehali!!!")]
[KSPEvent(guiActive = true, guiName = "Poehali!!!", isPersistent = true)]
public void Activate()
{
if (distanceToTarget == 0)
Expand Down Expand Up @@ -128,7 +128,8 @@ public void Activate()
}
if (wheelMotor.motorEnabled)
{
powerRequired += wheelMotor.inputResource.rate;
// powerRequired += wheelMotor.inputResource.rate;
powerRequired += wheelMotor.avgResRate;
}
operableWheels.Add(wheelMotor);
}
Expand Down Expand Up @@ -183,7 +184,7 @@ public void Activate()
ScreenMessages.PostScreenMessage("Bon Voyage!!!");
}

[KSPEvent(guiActive = true, guiName = "Deactivate", active = false)]
[KSPEvent(guiActive = true, guiName = "Deactivate", active = false, isPersistent = true)]
public void Deactivate()
{
isActive = false;
Expand Down Expand Up @@ -284,7 +285,8 @@ public void CalculatePowerRequirement()
if (wheelMotor != null)
{
if (wheelMotor.motorEnabled)
powerRequired += wheelMotor.inputResource.rate;
// powerRequired += wheelMotor.inputResource.rate;
powerRequired += wheelMotor.avgResRate;
}
}

Expand Down Expand Up @@ -410,7 +412,8 @@ private double CalculateSolarPower()
ModuleDeployableSolarPanel solarPanel = part.FindModuleImplementing<ModuleDeployableSolarPanel>();
if (solarPanel == null)
continue;
if (solarPanel.panelState != ModuleDeployableSolarPanel.panelStates.BROKEN)
// if (solarPanel.panelState != ModuleDeployableSolarPanel.panelStates.BROKEN)
if (solarPanel.deployState != ModuleDeployableSolarPanel.DeployState.BROKEN)
{
if (solarPanel.useCurve)
{
Expand All @@ -435,7 +438,8 @@ private double CalculateOtherPower()
continue;
if (powerModule.generatorIsActive || powerModule.isAlwaysActive)
{
foreach (var resource in powerModule.outputList)
// foreach (var resource in powerModule.outputList)
foreach (var resource in powerModule.resHandler.outputResources)
{
if (resource.name == "ElectricCharge")
{
Expand Down
6 changes: 5 additions & 1 deletion BonVoyage/PathFinder/PathFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,11 @@ public IEnumerable<Hex> GetNeighbours(int x, int y, bool passable = true) {

public double GetDistance() {
if (path != null)
return path.TotalCost;
{
Hex destination = path.LastStep;
double appendix = GeoUtils.GetDistance(destination.Latitude, destination.Longitude, targetLatitude, targetLongitude, mainBody.Radius);
return path.TotalCost + appendix;
}
else
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion BonVoyage/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.

[assembly: AssemblyVersion("0.10.1")]
[assembly: AssemblyVersion("0.10.2")]

// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
Expand Down
Binary file modified GameData/BonVoyage/BonVoyage.dll
Binary file not shown.
14 changes: 7 additions & 7 deletions GameData/BonVoyage/BonVoyage.version
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@
{
"MAJOR" : 0,
"MINOR" : 10,
"PATCH" : 1,
"PATCH" : 2,
"BUILD" : 0
},
"KSP_VERSION" :
{
"MAJOR" : 1,
"MINOR" : 1,
"PATCH" : 3
"MINOR" : 2,
"PATCH" : 0
},
"KSP_VERSION_MIN" :
{
"MAJOR" : 1,
"MINOR" : 1,
"PATCH" : 3
"MINOR" : 2,
"PATCH" : 0
},
"KSP_VERSION_MAX" :
{
"MAJOR" : 1,
"MINOR" : 1,
"PATCH" : 3
"MINOR" : 2,
"PATCH" : 0
}
}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Rovers background processing for KSP.

# Changelog
## 0.10.2
- Recompile for KSP 1.2
- Fixed last waypoint being last step of voyage

## 0.10.1
- Fixed control lock being applied to next switched vessel
- Moved "Bon Voyage control lock active" message higher on screen
Expand Down

0 comments on commit d596c32

Please sign in to comment.