Skip to content

Makes RemoveJoint(uid, id) recursive by default#6378

Open
deathride58 wants to merge 1 commit intospace-wizards:masterfrom
deathride58:recursivejointremoval
Open

Makes RemoveJoint(uid, id) recursive by default#6378
deathride58 wants to merge 1 commit intospace-wizards:masterfrom
deathride58:recursivejointremoval

Conversation

@deathride58
Copy link
Member

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 allows RemoveJoint() 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.

@deathride58
Copy link
Member Author

We're unable to reproduce the test fail on local here; it needs a restart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant