Makes RemoveJoint(uid, id) recursive by default#6378
Open
deathride58 wants to merge 1 commit intospace-wizards:masterfrom
Open
Makes RemoveJoint(uid, id) recursive by default#6378deathride58 wants to merge 1 commit intospace-wizards:masterfrom
deathride58 wants to merge 1 commit intospace-wizards:masterfrom
Conversation
Merged
2 tasks
Member
Author
|
We're unable to reproduce the test fail on local here; it needs a restart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a companion PR to space-wizards/space-station-14#42409
We had spent several hours straight trying to figure out a way to get PortalSystem to break a joint through any means possible before we decided to just chuck some code directly into the engine.
Currently,
RemoveJoint()does nothing if you're trying to remove a relayed joint. If you wanna remove a relayed joint, you gotta first look for said relayed joint. This is a massive headache.This PR is a massive improvement to the
RemoveJoint()API because it allowsRemoveJoint()to work a lot more like one would intuitively expect when relays are involved. Coders shouldn't have to add an entire for loop just to get rid of a single joint when it could very easily just be a single function call.With the exception of the companion PR (which is written with this PR in mind; portals won't properly sever grappling hook joints without this PR), this PR won't affect anything on upstream. Below section should be copy-pasted as a notice to downstreams that may potentially expect
RemoveJoint()to not delete relayed joints.Breaking Changes
RemoveJoint(uid, id)now accepts an optional recursive argument, which is true by default. This recursive argument controls whether or not relayed joints attached to the uid are also removed. Code that relies on relayed joints not being deleted should set the recursive argument to false.