From 4f0e20b0dd64bbd879479ebb303d600558f2b8b9 Mon Sep 17 00:00:00 2001 From: Batrachophreno Date: Fri, 25 Jul 2025 16:47:30 -0400 Subject: [PATCH] Fix disposals gremlins (#21044) Disposal bins no longer try to drain the entire atmosphere from the ship one tiny gulp at a time. --- code/modules/recycling/disposal.dm | 33 ++++++----- .../changelogs/Batrochophreno-DisposalFix.yml | 58 +++++++++++++++++++ 2 files changed, 76 insertions(+), 15 deletions(-) create mode 100644 html/changelogs/Batrochophreno-DisposalFix.yml diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 901742aa168..f4d7f55bf2b 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -475,28 +475,31 @@ if(length(contents)) if(mode == MODE_READY) spawn(0) - feedback_inc("disposal_auto_flush",1) - flush() + feedback_inc("disposal_auto_flush",1) + flush() flush_count = 0 - src.updateDialog() - // Validate whether we're pressurized or not... - if(mode == MODE_PRESSURIZING && air_contents.return_pressure() >= SEND_PRESSURE) - mode = MODE_READY - // ... And if we need to pressurize, do so. - else - src.pressurize() - update() - return - // If we're ready, don't draw any extra power if(mode == MODE_READY || !uses_air) update_use_power(POWER_USE_IDLE) + // We used the manual flush button + if(flush) + flush() + return + update() - // We used the manual flush button - if(flush && mode == MODE_READY) - flush() + // Validate whether we're pressurized or not. + if(mode == MODE_PRESSURIZING && air_contents.return_pressure() >= SEND_PRESSURE) + mode = MODE_READY + update() + return + + // If you turn this into a bare 'else' statement it just tries to pressurize infinitely and I don't know why. + else if(mode == MODE_PRESSURIZING && air_contents.return_pressure() < SEND_PRESSURE) + src.pressurize() + update() + return /** * If powered and working, transfer gas from local env to internal reservoir and use the required power to do so. diff --git a/html/changelogs/Batrochophreno-DisposalFix.yml b/html/changelogs/Batrochophreno-DisposalFix.yml new file mode 100644 index 00000000000..0bc35dd7323 --- /dev/null +++ b/html/changelogs/Batrochophreno-DisposalFix.yml @@ -0,0 +1,58 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: Batrachophrenoboocosmomachia + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Disposal units no longer try to siphon the entire atmosphere."