Skip to content

Commit

Permalink
Fix cases where part physicsMass isn't initialized yet
Browse files Browse the repository at this point in the history
  • Loading branch information
siimav committed Oct 29, 2024
1 parent 228c0e2 commit 672f58a
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ private IEnumerator RunVesselJointUpdateFunctionWhenSafe(Vessel v)
yield return new WaitUntil(() => !isEVAConstructionModeActive);
}

while (v.rootPart.physicsMass == 0)
{
if (KJRJointUtils.settings.debug)
Debug.Log("[KJR] Waiting for root part to obtain physicsMass");
yield return new WaitForEndOfFrame();
}

// Try to update the joints only once on a vessel that has changed multiple times during EVA Construction
if (!updatedVessels.Contains(v))
RunVesselJointUpdateFunction(v);
Expand Down

0 comments on commit 672f58a

Please sign in to comment.