From 6b7fce369be5cf579c894a8d9ee7af9947fc0271 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Sat, 14 Oct 2017 19:45:35 -0400 Subject: [PATCH 1/2] Merge pull request #31688 from duncathan/atmos-patch3 fixes filter NaN issue --- .../machinery/components/trinary_devices/filter.dm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm index 608ee6939c..212bc587d2 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm @@ -128,10 +128,15 @@ data["on"] = on data["pressure"] = round(target_pressure) data["max_pressure"] = round(MAX_OUTPUT_PRESSURE) - if(filter_type) - data["filter_type"] = GLOB.meta_gas_info[filter_type][META_GAS_ID] //ui code is garbage and this is needed for it to work grr + + if(filter_type) //ui code is garbage and this is needed for it to work grr + if(ispath(filter_type)) //we need to send the gas ID. if it's a path, get it from the metainfo list... + data["filter_type"] = GLOB.meta_gas_info[filter_type][META_GAS_ID] + else //...otherwise, it's already in the form we need. + data["filter_type"] = filter_type else data["filter_type"] = "none" + return data /obj/machinery/atmospherics/components/trinary/filter/ui_act(action, params)