Skip to content

Commit

Permalink
Merge pull request #679 from MOARdV/master
Browse files Browse the repository at this point in the history
Some forgotten updates
  • Loading branch information
MOARdV committed Dec 29, 2018
2 parents 4fa2c7f + 2d0090b commit acf5fb8
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 32 deletions.
6 changes: 3 additions & 3 deletions GameData/JSI/RasterPropMonitor/RasterPropMonitor.version
Expand Up @@ -6,12 +6,12 @@
{
"MAJOR": 0,
"MINOR": 30,
"PATCH": 5
"PATCH": 6
},
"KSP_VERSION":
{
"MAJOR": 1,
"MINOR": 5,
"MINOR": 6,
"PATCH": 0
},
"KSP_VERSION_MIN":
Expand All @@ -23,7 +23,7 @@
"KSP_VERSION_MAX":
{
"MAJOR": 1,
"MINOR": 5,
"MINOR": 6,
"PATCH": 99
}
}
2 changes: 1 addition & 1 deletion RasterPropMonitor.sln
Expand Up @@ -195,6 +195,6 @@ Global
$36.inheritsSet = Mono
$36.inheritsScope = text/plain
$36.scope = text/plain
version = 0.30.5
version = 0.30.6
EndGlobalSection
EndGlobal
6 changes: 3 additions & 3 deletions RasterPropMonitor/Auxiliary modules/JSIActionGroupSwitch.cs
Expand Up @@ -784,8 +784,8 @@ public override void OnUpdate()

if (consumingWhileActive && currentState && !forcedShutdown)
{
float requesting = (consumeWhileActiveAmount * TimeWarp.deltaTime);
float extracted = part.RequestResource(consumeWhileActiveName, requesting);
double requesting = (consumeWhileActiveAmount * TimeWarp.deltaTime);
double extracted = part.RequestResource(consumeWhileActiveName, requesting);
if (Math.Abs(extracted - requesting) > Math.Abs(requesting / 2))
{
// We don't have enough of the resource or can't produce more negative resource, so we should shut down...
Expand Down Expand Up @@ -893,7 +893,7 @@ public override void OnUpdate()
// If we're consuming resources on toggle, do that now.
if ((consumingOnToggleUp && newState) || (consumingOnToggleDown && !newState))
{
float extracted = part.RequestResource(consumeOnToggleName, consumeOnToggleAmount);
double extracted = part.RequestResource(consumeOnToggleName, (double)consumeOnToggleAmount);
if (Math.Abs(extracted - consumeOnToggleAmount) > Math.Abs(consumeOnToggleAmount / 2))
{
// We don't have enough of the resource, so we force a shutdown on the next loop.
Expand Down
6 changes: 3 additions & 3 deletions RasterPropMonitor/Auxiliary modules/JSIRadar.cs
Expand Up @@ -160,9 +160,9 @@ public void FixedUpdate()
// Resources check
if (resourceAmount > 0.0f)
{
float requested = resourceAmount * TimeWarp.fixedDeltaTime;
float supplied = part.RequestResource(resourceId, requested);
if (supplied < requested * 0.5f)
double requested = resourceAmount * TimeWarp.fixedDeltaTime;
double supplied = part.RequestResource(resourceId, requested);
if (supplied < requested * 0.5)
{
powered = false;
}
Expand Down
8 changes: 4 additions & 4 deletions RasterPropMonitor/Auxiliary modules/JSIVariableAnimator.cs
Expand Up @@ -661,11 +661,11 @@ private void TurnOn(double universalTime)

if (resourceAmount > 0.0f)
{
float requesting = (resourceAmount * TimeWarp.deltaTime);
if (requesting > 0.0f)
double requesting = (resourceAmount * TimeWarp.deltaTime);
if (requesting > 0.0)
{
float extracted = part.RequestResource(resourceName, requesting);
if (extracted < 0.5f * requesting)
double extracted = part.RequestResource(resourceName, requesting);
if (extracted < 0.5 * requesting)
{
// Insufficient power - shut down
TurnOff(universalTime, true);
Expand Down
2 changes: 1 addition & 1 deletion RasterPropMonitor/Handlers/JSISteerableCamera.cs
Expand Up @@ -160,7 +160,7 @@ private static Vector2 ClampToEdge(Vector2 position)
private Vector2 GetNormalizedScreenPosition(SteerableCameraParameters activeCamera, Vector3 directionVector, float cameraAspect)
{
// Transform direction using the active camera's rotation.
var targetTransformed = cameraObject.CameraRotation(activeCamera.currentYaw, -activeCamera.currentPitch).Inverse() * directionVector;
var targetTransformed = Quaternion.Inverse(cameraObject.CameraRotation(activeCamera.currentYaw, -activeCamera.currentPitch)) * directionVector;

// (x, y) provided the lateral displacement. (z) provides the "in front of / behind"
var targetDisp = new Vector2(targetTransformed.x, -targetTransformed.y);
Expand Down
21 changes: 5 additions & 16 deletions RasterPropMonitor/RasterPropMonitor.csproj
Expand Up @@ -40,27 +40,16 @@
</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="KSPAssets">
<HintPath>..\..\..\..\..\Games\Steam\steamapps\common\Kerbal Space Program\KSP_Data\Managed\KSPAssets.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\..\..\Games\Steam\steamapps\common\Kerbal Space Program\KSP_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine">
<HintPath>..\..\..\..\..\Games\Steam\steamapps\common\Kerbal Space Program\KSP_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
<HintPath>..\..\..\..\Games\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>..\..\..\..\..\Games\Steam\steamapps\common\Kerbal Space Program\KSP_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
<Private>False</Private>
<Reference Include="UnityEngine">
<HintPath>..\..\..\..\Games\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\..\..\..\..\Games\Steam\steamapps\common\Kerbal Space Program\KSP_Data\Managed\UnityEngine.UI.dll</HintPath>
<Private>False</Private>
<HintPath>..\..\..\..\Games\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion SharedAssemblyInfo.cs
Expand Up @@ -12,7 +12,7 @@
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
// Revision number is altered automatically.
[assembly: AssemblyVersion("0.30.5.*")]
[assembly: AssemblyVersion("0.30.6.*")]

// 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

0 comments on commit acf5fb8

Please sign in to comment.