Skip to content

Commit

Permalink
Merge pull request #13 from taniwha/docking-jointlock
Browse files Browse the repository at this point in the history
Allow ModuleDockingNode if only IJointLockState
  • Loading branch information
DBooots authored Aug 14, 2022
2 parents 1bc40a5 + 986c789 commit c44f87c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions ReCoupler/ReCouplerUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,18 @@ public static bool PartIsInvalidForPath(Part part, bool allowRoboJoints, bool al
if (!allowKASJoints && isKASPart(part))
return true;
// Accounts for ModuleGrappleNode and all of the Breaking Ground joints and servos.
if (!allowRoboJoints && !isKASPart(part) && (part.FindModuleImplementing<IJointLockState>() != null))
return true;
if (!allowRoboJoints && !isKASPart(part)) {
var mods = part.FindModulesImplementing<IJointLockState>();
bool haveNonDockingNode = false;
for (int i = mods.Count; i-- > 0; ) {
if (!(mods[i] is ModuleDockingNode)) {
haveNonDockingNode = true;
break;
}
}
if (haveNonDockingNode)
return true;
}
return false;
}

Expand Down

0 comments on commit c44f87c

Please sign in to comment.