Skip to content
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

Fix #195: clone the srfAttachNode when reversing a surface attachment during re-root #198

Closed
wants to merge 3 commits into from

Conversation

JonnyOThan
Copy link
Contributor

A different take on ReRootPreserveSurfaceAttach. Slightly closer to the apparent intended behavior from stock.

-this is more similar to the idea behind the stock code, except that instead of moving the part's actual srfAttachNode we just create a new one in the AttachNode list.  The stock ReverseSrfNodeDirection also, ironically, does not actually flip the orientation of the node.
-Remove Stock ChangeSrfNodePosition entirely because it's completely broken (as the previous patch had been doing)
-This approach seems to work really well right up until you save & load the craft.  The parts come back in the right positions, but the fake node no longer exists so other things break.
@JonnyOThan
Copy link
Contributor Author

hrm there seems to be some extra changes in here that shouldn't be :/ let me see if I can clean that up

-this is more similar to the idea behind the stock code, except that instead of moving the part's actual srfAttachNode we just create a new one in the AttachNode list.  The stock ReverseSrfNodeDirection also, ironically, does not actually flip the orientation of the node.
@JonnyOThan JonnyOThan changed the base branch from master to dev February 11, 2024 16:20
@gotmachine
Copy link
Contributor

gotmachine commented Feb 11, 2024

Well, as I mentioned in the related issue, my opinion is that this is way too hacky and is very likely to cause weird side effect for any piece of code expecting a surface attached part to be attached by the surface attach node.

Doing a quick GH search, I find way too many pieces of code doing checks of the part.srfAttachNode.attachedPart == something style for this patch to have no side effect. This even happen in some stock code.

@JonnyOThan JonnyOThan closed this Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants