Skip to content

Commit

Permalink
Fix #378
Browse files Browse the repository at this point in the history
  • Loading branch information
ihsoft committed Jan 16, 2021
1 parent e7b7a74 commit 34ce865
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# 1.28 (pre-release):
* [Fix #378] Dropped parts cannot be moved or trigger physics.
* [Fix #379] KIS functionality interferes with the stock construction mode.
* [Fix #380] Model equippable parts cannot be carried.
* [Fix #381] Hide UI command doesn't play well with KIS.
Expand Down
8 changes: 8 additions & 0 deletions Source/KIS_Shared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,14 @@ public static void MoveAssembly(Part assemblyRoot, string srcAttachNodeId,
/// </param>
public static void PlaceVessel(
Vessel movingVessel, Vector3 newPosition, Quaternion newRotation, Vessel refVessel) {
// Find and destroy static attach joints that game applies to fix the vessels on the ground.
foreach (var joint in movingVessel.rootPart.gameObject.GetComponents<Joint>()) {
if (joint.connectedBody == null) {
DebugEx.Fine("Dropping vessel static attach joint");
// The joint will be automatically re-created once the vessel is moved.
GameObject.DestroyImmediate(joint);
}
}
movingVessel.SetPosition(newPosition, usePristineCoords: true);
movingVessel.SetRotation(newRotation);
var refVelocity = Vector3.zero;
Expand Down

0 comments on commit 34ce865

Please sign in to comment.