From 17f708ed57385d4b75cab7c76fda922fa35e28c2 Mon Sep 17 00:00:00 2001 From: siimav Date: Tue, 19 Mar 2024 14:32:29 +0200 Subject: [PATCH] Use stock method for finding launch clamps --- .../KJRLaunchClampReinforcementModule.cs | 2 +- .../KerbalJointReinforcement/KJRManager.cs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/KerbalJointReinforcement/KerbalJointReinforcement/KJRLaunchClampReinforcementModule.cs b/KerbalJointReinforcement/KerbalJointReinforcement/KJRLaunchClampReinforcementModule.cs index b91364d..aad2bfe 100644 --- a/KerbalJointReinforcement/KerbalJointReinforcement/KJRLaunchClampReinforcementModule.cs +++ b/KerbalJointReinforcement/KerbalJointReinforcement/KJRLaunchClampReinforcementModule.cs @@ -159,7 +159,7 @@ private void BreakAllInvalidJoints() foreach (Part p in n.vessel.Parts) { - if (p.Modules.Contains()) + if (p.isLaunchClamp()) continue; ConfigurableJoint[] possibleConnections = p.GetComponents(); diff --git a/KerbalJointReinforcement/KerbalJointReinforcement/KJRManager.cs b/KerbalJointReinforcement/KerbalJointReinforcement/KJRManager.cs index 20f87a4..21a460e 100644 --- a/KerbalJointReinforcement/KerbalJointReinforcement/KJRManager.cs +++ b/KerbalJointReinforcement/KerbalJointReinforcement/KJRManager.cs @@ -174,7 +174,7 @@ private void OnVesselOffRails(Vessel v) if (p.attachJoint) p.attachJoint.SetUnbreakable(true, false); - if (p.Modules.Contains()) + if (p.isLaunchClamp()) { vesselHasLaunchClamps = true; Joint[] partJoints = p.GetComponents(); @@ -196,7 +196,7 @@ private void OnVesselOffRails(Vessel v) for (int i = 0; i < v.Parts.Count; ++i) { Part p = v.Parts[i]; - if (p.Modules.Contains()) + if (p.isLaunchClamp()) { vesselHasLaunchClamps = true; break; @@ -301,7 +301,7 @@ private void RunVesselJointUpdateFunction(Vessel v) } if ((KJRJointUtils.settings.reinforceLaunchClampsFurther || KJRJointUtils.settings.clampJointHasInfiniteStrength) && - p.parent != null && p.Modules.Contains()) + p.parent != null && p.isLaunchClamp()) { p.breakingForce = Mathf.Infinity; p.breakingTorque = Mathf.Infinity; @@ -405,7 +405,7 @@ private void UpdatePartJoint(Part p) StringBuilder debugString = KJRJointUtils.settings.debug ? new StringBuilder() : null; bool addAdditionalJointToParent = KJRJointUtils.settings.multiPartAttachNodeReinforcement; - //addAdditionalJointToParent &= !(p.Modules.Contains("LaunchClamp") || (p.parent.Modules.Contains("ModuleDecouple") || p.parent.Modules.Contains("ModuleAnchoredDecoupler"))); + //addAdditionalJointToParent &= !(p.isLaunchClamp() || (p.parent.Modules.Contains("ModuleDecouple") || p.parent.Modules.Contains("ModuleAnchoredDecoupler"))); addAdditionalJointToParent &= !p.Modules.Contains(); double partMass = p.physicsMass; @@ -961,7 +961,7 @@ public void MultiPartJointTreeChildren(Vessel v) { Part p = v.Parts[i]; if (p.rb != null && - p.children.Count == 0 && !p.Modules.Contains("LaunchClamp") && + p.children.Count == 0 && !p.isLaunchClamp() && p.physicsMass > KJRJointUtils.settings.massForAdjustment) { childPartsToConnect.Add(p);