-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When AutoStrutDrift = true an extended piston will move in unexpected ways causing crafts to act unexpectedly #96
Comments
The AutoStrutDrift patch is supposed to skip handling autostruts targeting or originating to/from a servo part, mainly because there is some additional complexity in accounting for the servo current offset that I didn't have the courage to tackle. But somehow, while I covered the "targeting to a servo" case, I forgot the "originating from a servo" case, resulting in the strut ignoring that the servo is extended and trying to pull it in the retracted position. I will add the necessary check to fix this. For reference, the fix is replacing this : KSPCommunityFixes/KSPCommunityFixes/BugFixes/AutoStrutDrift.cs Lines 32 to 41 in 7147ab0
with // We only correct autostruts directly connected to the main rigidbody of the part.
// Specifically, we don't handle autostruts connected from/to a BG robotic part.
// It might be possible to handle that case by getting the offset between the part and the servoRb, not entirely sure.
if (joint.connectedBody.NotDestroyedRefNotEquals(anchor.rb))
{
#if DEBUG
Debug.Log($"[AutoStrutDrift] Skipping autostrut for {__instance}. The connected rb ({joint.connectedBody}) is different from the anchor rb ({anchor.rb}), the anchor is likely a robotics part");
#endif
return;
}
if (__instance.Rigidbody.NotDestroyedRefNotEquals(joint.GetComponent<Rigidbody>()))
{
#if DEBUG
Debug.Log($"[AutoStrutDrift] Skipping autostrut for {__instance}. The part rb ({__instance.Rigidbody}) is different from the rb hosting the joint ({joint.GetComponent<Rigidbody>()}), the part is likely a robotics part");
#endif
return;
} |
…uts originating from a servo part.
Fixed in 1.25.2 |
AutoStrutDrift Bug Piston.zip
Tested with the following:
KSP 1.12.3 DLCs no mods
KSP 1.12.3 DLCs KSPCF/Harmony/modulemanager
KSPCommunityFixes_1.22.2
HarmonyKSP_2.2.1.0_for_KSP1.8+
ModuleManager.4.2.2.dll
Note that this problem happens when the piston is connected one way. If its connected to the other node this problem doesn't happen.
https://youtu.be/UYVAc9oj4Gw Video Evidence
Also note use of timewarp
The text was updated successfully, but these errors were encountered: