Fix omni filters reacting incorrectly to some configuration changes (#7633)

*Fixes omni filters reacting incorrectly to configuration changes that swap ports.
This commit is contained in:
Meghan-Rossi
2020-09-11 08:12:19 +01:00
committed by VirgoBot
parent af50bc8e02
commit 5bfd87a63c
2 changed files with 8 additions and 1 deletions

View File

@@ -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

View File

@@ -0,0 +1,4 @@
author: Meghan-Rossi
delete-after: True
changes:
- bugfix: "Fixed omni filters reacting incorrectly to configuration changes that swap ports."