Skip to content

Commit

Permalink
Prep for v3.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
ferram4 committed Apr 29, 2016
1 parent b079369 commit c753398
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"VERSION" : {
"MAJOR" : 3,
"MINOR" : 1,
"PATCH" : 5
"PATCH" : 6
},
"KSP_VERSION_MIN" : {
"MAJOR" : 1,
Expand All @@ -19,7 +19,7 @@
"KSP_VERSION_MAX" : {
"MAJOR" : 1,
"MINOR" : 1,
"PATCH" : 0
"PATCH" : 1
}
}

Binary file not shown.
Binary file modified KerbalJointReinforcement/KerbalJointReinforcement.v12.suo
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Kerbal Joint Reinforcement, v3.1.5
Kerbal Joint Reinforcement, v3.1.6
Copyright 2015, Michael Ferrara, aka Ferram4
This file is part of Kerbal Joint Reinforcement.
Expand Down Expand Up @@ -189,7 +189,7 @@ private void BreakAllInvalidJointsAndRebuild()

foreach (Part p in n.vessel.Parts)
{
if (p is StrutConnector || p.Modules.Contains("LaunchClamp"))
if (p is StrutConnector || p.Modules.Contains<LaunchClamp>())
continue;

ConfigurableJoint[] possibleConnections = p.GetComponents<ConfigurableJoint>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Kerbal Joint Reinforcement, v3.1.5
Kerbal Joint Reinforcement, v3.1.6
Copyright 2015, Michael Ferrara, aka Ferram4
This file is part of Kerbal Joint Reinforcement.
Expand Down Expand Up @@ -341,9 +341,9 @@ public static void LoadConstants()
public static Vector3 GuessUpVector(Part part)
{
// For intakes, use the intake vector
if (part.Modules.Contains("ModuleResourceIntake"))
if (part.Modules.Contains<ModuleResourceIntake>())
{
ModuleResourceIntake i = part.Modules["ModuleResourceIntake"] as ModuleResourceIntake;
ModuleResourceIntake i = part.Modules.GetModule<ModuleResourceIntake>();
Transform intakeTrans = part.FindModelTransform(i.intakeTransformName);
return part.transform.InverseTransformDirection(intakeTrans.forward);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Kerbal Joint Reinforcement, v3.1.5
Kerbal Joint Reinforcement, v3.1.6
Copyright 2015, Michael Ferrara, aka Ferram4
This file is part of Kerbal Joint Reinforcement.
Expand Down Expand Up @@ -118,7 +118,7 @@ private void BreakAllInvalidJoints()

foreach (Part p in n.vessel.Parts)
{
if (p is StrutConnector || p.Modules.Contains("LaunchClamp"))
if (p is StrutConnector || p.Modules.Contains<LaunchClamp>())
continue;


Expand Down
22 changes: 11 additions & 11 deletions KerbalJointReinforcement/KerbalJointReinforcement/KJRManager.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Kerbal Joint Reinforcement, v3.1.5
Kerbal Joint Reinforcement, v3.1.6
Copyright 2015, Michael Ferrara, aka Ferram4
This file is part of Kerbal Joint Reinforcement.
Expand Down Expand Up @@ -169,15 +169,15 @@ private void RunVesselJointUpdateFunction(Vessel v)
}

if (KJRJointUtils.reinforceLaunchClampsFurther)
if (p.Modules.Contains("LaunchClamp") && p.parent != null)
if (p.Modules.Contains<LaunchClamp>() && p.parent != null)
{
p.breakingForce = Mathf.Infinity;
p.breakingTorque = Mathf.Infinity;
p.mass = Mathf.Max(p.mass, (p.parent.mass + p.parent.GetResourceMass()) * 0.01f); //We do this to make sure that there is a mass ratio of 100:1 between the clamp and what it's connected to. This helps counteract some of the wobbliness simply, but also allows some give and springiness to absorb the initial physics kick
if (KJRJointUtils.debug)
Debug.Log("KJR: Launch Clamp Break Force / Torque increased");

if (!p.Modules.Contains("KJRLaunchClampReinforcementModule"))
if (!p.Modules.Contains<KJRLaunchClampReinforcementModule>())
KJRJointUtils.AddLaunchClampReinforcementModule(p);
}
}
Expand All @@ -188,7 +188,7 @@ private void RunVesselJointUpdateFunction(Vessel v)

private bool ValidDecoupler(Part p)
{
return (p.Modules.Contains("ModuleDecouple") || p.Modules.Contains("ModuleAnchoredDecoupler")) && !p.Modules.Contains("KJRDecouplerReinforcementModule");
return (p.Modules.Contains<ModuleDecouple>() || p.Modules.Contains<ModuleAnchoredDecoupler>()) && !p.Modules.Contains<KJRDecouplerReinforcementModule>();
}

/* public void LateUpdate()
Expand Down Expand Up @@ -259,7 +259,7 @@ public void FixedUpdate()
jointList.Add(j);
Debug.Log("Part: " + p.partInfo.title + " BreakForce = " + j.breakForce + " BreakTorque = " + j.breakTorque);
}*/
if (p.Modules.Contains("LaunchClamp"))
if (p.Modules.Contains<LaunchClamp>())
{
foreach (Joint j in partJoints)
if (j.connectedBody == null)
Expand All @@ -279,7 +279,7 @@ public void FixedUpdate()
else
{
foreach (Part p in v.Parts)
if (p.Modules.Contains("LaunchClamp"))
if (p.Modules.Contains<LaunchClamp>())
{
easing = true;
break;
Expand Down Expand Up @@ -394,9 +394,9 @@ private void UpdatePartJoint(Part p)
p.attachMethod = AttachNodeMethod.LOCKED_JOINT;
}
}
if (p.Modules.Contains("CModuleStrut"))
if (p.Modules.Contains<CModuleStrut>())
{
CModuleStrut s = (CModuleStrut)p.Modules["CModuleStrut"];
CModuleStrut s = p.Modules.GetModule<CModuleStrut>();

if (!(s.jointTarget == null || s.jointRoot == null))
{
Expand Down Expand Up @@ -439,7 +439,7 @@ private void UpdatePartJoint(Part p)

bool addAdditionalJointToParent = KJRJointUtils.multiPartAttachNodeReinforcement;
//addAdditionalJointToParent &= !(p.Modules.Contains("LaunchClamp") || (p.parent.Modules.Contains("ModuleDecouple") || p.parent.Modules.Contains("ModuleAnchoredDecoupler")));
addAdditionalJointToParent &= !(p is StrutConnector || p.Modules.Contains("CModuleStrut"));
addAdditionalJointToParent &= !(p is StrutConnector || p.Modules.Contains<CModuleStrut>());

float partMass = p.mass + p.GetResourceMass();
for (int i = 0; i < jointList.Count; i++)
Expand Down Expand Up @@ -472,8 +472,8 @@ private void UpdatePartJoint(Part p)
if (node == null)
{
// Check if it's a pair of coupled docking ports
var dock1 = p.Modules["ModuleDockingNode"] as ModuleDockingNode;
var dock2 = p.parent.Modules["ModuleDockingNode"] as ModuleDockingNode;
var dock1 = p.Modules.GetModule<ModuleDockingNode>();
var dock2 = p.parent.Modules.GetModule<ModuleDockingNode>();

//Debug.Log(dock1 + " " + (dock1 ? ""+dock1.dockedPartUId : "?") + " " + dock2 + " " + (dock2 ? ""+dock2.dockedPartUId : "?"));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Kerbal Joint Reinforcement, v3.1.5
Kerbal Joint Reinforcement, v3.1.6
Copyright 2015, Michael Ferrara, aka Ferram4
This file is part of Kerbal Joint Reinforcement.
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Kerbal Joint Reinforcement, v3.1.5
Kerbal Joint Reinforcement, v3.1.6
==========================

Physics stabilizer plugin for Kerbal Space Program
Expand Down Expand Up @@ -119,6 +119,12 @@ These types are currently not used, but removing the a in front of them will cau
***********************
****** CHANGELOG ******
***********************
v3.1.6
Features
--Update to ensure KSP 1.1.1 compatibility
--Minor optimization in joint setups
--Remove B9 pWings from stiffening exemption, as it is unnecessary

v3.1.5
Features
--Updated to be compatible with KSP 1.1
Expand Down

0 comments on commit c753398

Please sign in to comment.