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.
Description
So uhhh the last fix introduced a severe bug that caused FTL to fail if the FTLing shuttle contained an entity who had a leash attached to themselves in their inventory (sorry 😭). This reworks the system to fix that and more bugs.
Leash joints can now be created/disposed of dynamically throughout the lifespan of a leash, without forcing the removal of the latter. This is used to prevent the physics engine from creating a joint that would connect an entity with itself (which is exactly what happens when you put a leash attached to yourself in your inventory.
This also indirectly fixes the issue with leashes breaking when put in the inventory of the leashed person, and allows a person to attach a leash to themselves, and ensures that leashes break when going through portals, unless the destination portal is close enough.
Media
8mb.video-V84-JLBejqoT.mp4
Changelog
🆑