Skip to content

Commit

Permalink
Remove a bunch of unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
siimav committed Jun 3, 2024
1 parent b64db3f commit dbf0f01
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 411 deletions.
15 changes: 0 additions & 15 deletions Source/ProceduralFairings/FairingBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -736,15 +736,13 @@ public System.Collections.IEnumerator HandleAutomaticDecoupling()

if (DecouplerEnabled && TopNodePartPresent && autoDecoupleTopNode && !FairingPresent)
{
RemoveTopPartJoints();
Decoupler.Decouple();
}
Fields[nameof(autoDecoupleTopNode)].guiActive = DecouplerEnabled && Mode == BaseMode.Adapter && TopNodePartPresent;
}

#region Node / Attached Part Utilities

public Part GetBottomPart() => (part.FindAttachNode("bottom") is AttachNode node) ? node.attachedPart : null;
public Part GetTopPart() => (part.FindAttachNode(topNodeName) is AttachNode node) ? node.attachedPart : null;
public bool TopNodePartPresent => GetTopPart() is Part;
public bool FairingPresent
Expand Down Expand Up @@ -790,19 +788,6 @@ private void RemoveJoints()
joints.Clear();
}

void RemoveTopPartJoints()
{
if (GetTopPart() is Part topPart && GetBottomPart() is Part bottomPart &&
topPart.gameObject.GetComponents<ConfigurableJoint>() is ConfigurableJoint[] components)
{
foreach (ConfigurableJoint configurableJoint in components)
{
if (configurableJoint.connectedBody == bottomPart.Rigidbody)
Destroy(configurableJoint);
}
}
}

private IEnumerator<YieldInstruction> CreateAutoStruts()
{
while (!FlightGlobals.ready || vessel.packed || !vessel.loaded)
Expand Down
Loading

0 comments on commit dbf0f01

Please sign in to comment.