-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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 gas pipe leaking when unanchoring or breaking them #33774
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix. Thanks especially for looking into past related work and giving important technical context. I have a few questions inline.
Content.Server/Atmos/Piping/EntitySystems/AtmosUnsafeUnanchorSystem.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix. Up to you what you want to do with the pressure warning. Please go ahead and merge when you're finished.
I reverted the pressure warning popup change as discussed above. |
…#33774) * fix gas pipe unanchoring * remove unneeded update * revert popup change
About the PR
Currently when unanchoring a pipe some of the gas will leak from it, but not all of it. This means you can pick it up as a small 200L tank in your backpack and release the gas into the atmosphere by anchoring and unachoring it a second time, which can be potentially abused.$V_{pipe} / V_{total}$ which was suggested by @Partmedia in #29574.
This PR solves this by making the leak amount equal to
The removed pipe will then always be completely empty.
Why / Balance
Fixes #32632
Technical details
I simplified the way the leak amount is calculated, removing the pressure dependency and making it only volume dependend, which makes more sense. The warning popup will now show up when the pipes pressure is above standard atmospheric pressure, below that the gas still leaks, but the amount is insignificant.
When the pipe is unanchored, the node group update will be scheduled for the next tick. However, this will mean we cannot yet remove the gas from the pipe element since it is still connected with its neighbors. We cannot do this in the next tick either, because the information about the pipe entity and its node is lost by then. To solve this we force a manual update for the scheduled node groups. This should be fine performance-wise since it only happens once when a player unanchors it and the update won't be repeated in the next tick.
Media
pipe.leak.mp4
Requirements
Breaking changes
none
Changelog
🆑