From 5bfd87a63ca62bb9b9cb2d823074712fe6fea606 Mon Sep 17 00:00:00 2001 From: Meghan-Rossi <56671765+Meghan-Rossi@users.noreply.github.com> Date: Fri, 11 Sep 2020 08:12:19 +0100 Subject: [PATCH] Fix omni filters reacting incorrectly to some configuration changes (#7633) *Fixes omni filters reacting incorrectly to configuration changes that swap ports. --- code/ATMOSPHERICS/components/omni_devices/filter.dm | 5 ++++- html/changelogs/Meghan Rossi - fix omni filters.yml | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 html/changelogs/Meghan Rossi - fix omni filters.yml diff --git a/code/ATMOSPHERICS/components/omni_devices/filter.dm b/code/ATMOSPHERICS/components/omni_devices/filter.dm index 56171a0880..00e2f9d5dc 100644 --- a/code/ATMOSPHERICS/components/omni_devices/filter.dm +++ b/code/ATMOSPHERICS/components/omni_devices/filter.dm @@ -33,8 +33,10 @@ return ..() /obj/machinery/atmospherics/omni/atmos_filter/sort_ports() + var/any_updated = FALSE for(var/datum/omni_port/P in ports) if(P.update) + any_updated = TRUE if(output == P) output = null if(input == P) @@ -50,6 +52,8 @@ output = P if(ATM_O2 to ATM_N2O) atmos_filters += P + if(any_updated) + rebuild_filtering_list() /obj/machinery/atmospherics/omni/atmos_filter/error_check() if(!input || !output || !atmos_filters) @@ -231,7 +235,6 @@ target_port.mode = mode if(target_port.mode != previous_mode) handle_port_change(target_port) - rebuild_filtering_list() else return else diff --git a/html/changelogs/Meghan Rossi - fix omni filters.yml b/html/changelogs/Meghan Rossi - fix omni filters.yml new file mode 100644 index 0000000000..595dd331e7 --- /dev/null +++ b/html/changelogs/Meghan Rossi - fix omni filters.yml @@ -0,0 +1,4 @@ +author: Meghan-Rossi +delete-after: True +changes: + - bugfix: "Fixed omni filters reacting incorrectly to configuration changes that swap ports." \ No newline at end of file