From c3db2ed8abecf4edc37d28c7d2d55f0e88f7e20e Mon Sep 17 00:00:00 2001 From: Putnam3145 Date: Wed, 23 Jun 2021 01:34:47 -0700 Subject: [PATCH] Fixes the varedit interface --- .../modules/atmospherics/gasmixtures/gas_mixture.dm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/code/modules/atmospherics/gasmixtures/gas_mixture.dm b/code/modules/atmospherics/gasmixtures/gas_mixture.dm index 2632a24915..ed4b1f63c2 100644 --- a/code/modules/atmospherics/gasmixtures/gas_mixture.dm +++ b/code/modules/atmospherics/gasmixtures/gas_mixture.dm @@ -77,17 +77,16 @@ GLOBAL_LIST_INIT(auxtools_atmos_initialized,FALSE) var/list/gases = get_gases() for(var/gas in gases) gases[gas] = get_moles(gas) - var/gastype = input(usr, "What kind of gas?", "Set Gas") as null|anything in subtypesof(/datum/gas) - if(!ispath(gastype, /datum/gas)) + var/gasid = input(usr, "What kind of gas?", "Set Gas") as null|anything in GLOB.gas_data.ids + if(!gasid) return - var/amount = input(usr, "Input amount", "Set Gas", gases[gastype] || 0) as num|null + var/amount = input(usr, "Input amount", "Set Gas", gases[gasid] || 0) as num|null if(!isnum(amount)) return amount = max(0, amount) - var/datum/gas/gas = gastype - log_admin("[key_name(usr)] modified gas mixture [REF(src)]: Set gas type [gastype] to [amount] moles.") - message_admins("[key_name(usr)] modified gas mixture [REF(src)]: Set gas type [gastype] to [amount] moles.") - set_moles(initial(gas.id), amount) + log_admin("[key_name(usr)] modified gas mixture [REF(src)]: Set gas [gasid] to [amount] moles.") + message_admins("[key_name(usr)] modified gas mixture [REF(src)]: Set gas [gasid] to [amount] moles.") + set_moles(gasid, amount) if(href_list[VV_HK_SET_TEMPERATURE]) var/temp = input(usr, "Set the temperature of this mixture to?", "Set Temperature", return_temperature()) as num|null if(!isnum(temp))