From 905f32b193d6a14a611c32b765e32256f6b5fa73 Mon Sep 17 00:00:00 2001 From: deathride58 Date: Sun, 14 Apr 2019 16:40:37 -0400 Subject: [PATCH] further optimizes performance by making all of the meta gas properties use their own individual lists instead of being in a messy nested list --- code/datums/diseases/advance/symptoms/heal.dm | 2 +- code/game/machinery/computer/atmos_control.dm | 2 +- .../objects/effects/spawners/bombspawner.dm | 2 +- code/game/objects/items/devices/PDA/PDA.dm | 2 +- code/game/objects/items/devices/scanners.dm | 4 +- code/modules/admin/verbs/diagnostics.dm | 2 +- .../environmental/LINDA_turf_tile.dm | 5 +- .../atmospherics/gasmixtures/gas_mixture.dm | 19 ++++- .../atmospherics/gasmixtures/gas_types.dm | 73 ++++++++++++++----- .../atmospherics/gasmixtures/reactions.dm | 4 +- .../atmospherics/machinery/airalarm.dm | 6 +- .../components/trinary_devices/filter.dm | 9 +-- .../components/unary_devices/tank.dm | 2 +- .../components/unary_devices/vent_scrubber.dm | 5 +- .../machinery/portable/canister.dm | 6 +- .../machinery/portable/scrubber.dm | 5 +- .../subtypes/atmospherics.dm | 2 +- .../integrated_electronics/subtypes/input.dm | 2 +- .../mob/living/silicon/pai/software.dm | 2 +- code/modules/mob/mob.dm | 2 +- .../file_system/programs/sm_monitor.dm | 4 +- .../living/silicon/robot/dogborg_equipment.dm | 2 +- 22 files changed, 101 insertions(+), 61 deletions(-) diff --git a/code/datums/diseases/advance/symptoms/heal.dm b/code/datums/diseases/advance/symptoms/heal.dm index ff9eda0766..0a4d192319 100644 --- a/code/datums/diseases/advance/symptoms/heal.dm +++ b/code/datums/diseases/advance/symptoms/heal.dm @@ -372,7 +372,7 @@ environment = M.loc.return_air() if(environment) plasmamount = environment.gases[/datum/gas/plasma] - if(plasmamount && plasmamount > GLOB.meta_gas_info[/datum/gas/plasma][META_GAS_MOLES_VISIBLE]) //if there's enough plasma in the air to see + if(plasmamount && plasmamount > GLOB.meta_gas_visibility[/datum/gas/plasma]) //if there's enough plasma in the air to see . += power * 0.5 if(M.reagents.has_reagent("plasma")) . += power * 0.75 diff --git a/code/game/machinery/computer/atmos_control.dm b/code/game/machinery/computer/atmos_control.dm index 191498e4e9..6576f51e46 100644 --- a/code/game/machinery/computer/atmos_control.dm +++ b/code/game/machinery/computer/atmos_control.dm @@ -59,7 +59,7 @@ var/total_moles = air_sample.total_moles() if(total_moles) for(var/gas_id in air_sample.gases) - var/gas_name = GLOB.meta_gas_info[gas_id][META_GAS_NAME] + var/gas_name = GLOB.meta_gas_names[gas_id] signal.data["gases"][gas_name] = air_sample.gases[gas_id] / total_moles * 100 radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA) diff --git a/code/game/objects/effects/spawners/bombspawner.dm b/code/game/objects/effects/spawners/bombspawner.dm index 426abb5514..65395d534a 100644 --- a/code/game/objects/effects/spawners/bombspawner.dm +++ b/code/game/objects/effects/spawners/bombspawner.dm @@ -1,6 +1,6 @@ #define CELSIUS_TO_KELVIN(T_K) ((T_K) + T0C) -#define OPTIMAL_TEMP_K_PLA_BURN_SCALE(PRESSURE_P,PRESSURE_O,TEMP_O) (((PRESSURE_P) * GLOB.meta_gas_info[/datum/gas/plasma][META_GAS_SPECIFIC_HEAT]) / (((PRESSURE_P) * GLOB.meta_gas_info[/datum/gas/plasma][META_GAS_SPECIFIC_HEAT] + (PRESSURE_O) * GLOB.meta_gas_info[/datum/gas/oxygen][META_GAS_SPECIFIC_HEAT]) / PLASMA_UPPER_TEMPERATURE - (PRESSURE_O) * GLOB.meta_gas_info[/datum/gas/oxygen][META_GAS_SPECIFIC_HEAT] / CELSIUS_TO_KELVIN(TEMP_O))) +#define OPTIMAL_TEMP_K_PLA_BURN_SCALE(PRESSURE_P,PRESSURE_O,TEMP_O) (((PRESSURE_P) * GLOB.meta_gas_specific_heats[/datum/gas/plasma]) / (((PRESSURE_P) * GLOB.meta_gas_specific_heats[/datum/gas/plasma] + (PRESSURE_O) * GLOB.meta_gas_specific_heats[/datum/gas/oxygen]) / PLASMA_UPPER_TEMPERATURE - (PRESSURE_O) * GLOB.meta_gas_specific_heats[/datum/gas/oxygen] / CELSIUS_TO_KELVIN(TEMP_O))) #define OPTIMAL_TEMP_K_PLA_BURN_RATIO(PRESSURE_P,PRESSURE_O,TEMP_O) (CELSIUS_TO_KELVIN(TEMP_O) * PLASMA_OXYGEN_FULLBURN * (PRESSURE_P) / (PRESSURE_O)) /obj/effect/spawner/newbomb diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index 29cd150fd3..4215e2e0a2 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -360,7 +360,7 @@ GLOBAL_LIST_EMPTY(PDAs) for(var/id in env_gases) var/gas_level = env_gases[id]/total_moles if(gas_level > 0) - dat += "[GLOB.meta_gas_info[id][META_GAS_NAME]]: [round(gas_level*100, 0.01)]%
" + dat += "[GLOB.meta_gas_names[id]]: [round(gas_level*100, 0.01)]%
" dat += "Temperature: [round(environment.temperature-T0C)]°C
" dat += "
" diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 37243acc40..e4e37c4b3b 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -450,7 +450,7 @@ SLIME SCANNER if(id in GLOB.hardcoded_gases) continue var/gas_concentration = env_gases[id]/total_moles - to_chat(user, "[GLOB.meta_gas_info[id][META_GAS_NAME]]: [round(gas_concentration*100, 0.01)] % ([round(env_gases[id], 0.01)] mol)") + to_chat(user, "[GLOB.meta_gas_names[id]]: [round(gas_concentration*100, 0.01)] % ([round(env_gases[id], 0.01)] mol)") to_chat(user, "Temperature: [round(environment.temperature-T0C, 0.01)] °C ([round(environment.temperature, 0.01)] K)") /obj/item/analyzer/AltClick(mob/user) //Barometer output for measuring when the next storm happens @@ -541,7 +541,7 @@ SLIME SCANNER var/list/cached_gases = air_contents.gases for(var/id in cached_gases) var/gas_concentration = cached_gases[id]/total_moles - to_chat(user, "[GLOB.meta_gas_info[id][META_GAS_NAME]]: [round(gas_concentration*100, 0.01)] % ([round(cached_gases[id], 0.01)] mol)") + to_chat(user, "[GLOB.meta_gas_names[id]]: [round(gas_concentration*100, 0.01)] % ([round(cached_gases[id], 0.01)] mol)") to_chat(user, "Temperature: [round(temperature - T0C,0.01)] °C ([round(temperature, 0.01)] K)") else diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm index 83651f81a7..b19b2a91d8 100644 --- a/code/modules/admin/verbs/diagnostics.dm +++ b/code/modules/admin/verbs/diagnostics.dm @@ -11,7 +11,7 @@ for(var/id in env_gases) var/moles = env_gases[id] if (moles >= 0.00001) - lines += "[GLOB.meta_gas_info[id][META_GAS_NAME]]: [moles] mol" + lines += "[GLOB.meta_gas_names[id]]: [moles] mol" to_chat(usr, lines.Join("\n")) /client/proc/air_status(turf/target) diff --git a/code/modules/atmospherics/environmental/LINDA_turf_tile.dm b/code/modules/atmospherics/environmental/LINDA_turf_tile.dm index 0fa81970d3..2a182a68b4 100644 --- a/code/modules/atmospherics/environmental/LINDA_turf_tile.dm +++ b/code/modules/atmospherics/environmental/LINDA_turf_tile.dm @@ -121,9 +121,8 @@ if (nonoverlaying_gases[id]) continue var/gas = gases[id] - var/gas_meta = GLOB.meta_gas_info[id] - var/gas_overlay = gas_meta[META_GAS_OVERLAY] - if(gas_overlay && gas > gas_meta[META_GAS_MOLES_VISIBLE]) + var/gas_overlay = GLOB.meta_gas_overlays[id] + if(gas_overlay && gas > GLOB.meta_gas_visibility[id]) . += gas_overlay[min(FACTOR_GAS_VISIBLE_MAX, CEILING(gas / MOLES_GAS_VISIBLE_STEP, 1))] /proc/typecache_of_gases_with_no_overlays() diff --git a/code/modules/atmospherics/gasmixtures/gas_mixture.dm b/code/modules/atmospherics/gasmixtures/gas_mixture.dm index fa64e95bc0..9858db2abb 100644 --- a/code/modules/atmospherics/gasmixtures/gas_mixture.dm +++ b/code/modules/atmospherics/gasmixtures/gas_mixture.dm @@ -5,7 +5,16 @@ What are the archived variables for? */ #define MINIMUM_HEAT_CAPACITY 0.0003 #define MINIMUM_MOLE_COUNT 0.01 -GLOBAL_LIST_INIT(meta_gas_info, meta_gas_list()) //see ATMOSPHERICS/gas_types.dm + +//Unomos - global list inits for all of the meta gas lists. +//This setup allows procs to only look at one list instead of trying to dig around in lists-within-lists +GLOBAL_LIST_INIT(meta_gas_specific_heats, meta_gas_heat_list()) +GLOBAL_LIST_INIT(meta_gas_names, meta_gas_name_list()) +GLOBAL_LIST_INIT(meta_gas_visibility, meta_gas_visibility_list()) +GLOBAL_LIST_INIT(meta_gas_overlays, meta_gas_overlay_list()) +GLOBAL_LIST_INIT(meta_gas_dangers, meta_gas_danger_list()) +GLOBAL_LIST_INIT(meta_gas_ids, meta_gas_id_list()) +GLOBAL_LIST_INIT(meta_gas_fusions, meta_gas_fusion_list()) /datum/gas_mixture var/list/gases = list() var/temperature = 0 //kelvins @@ -24,10 +33,10 @@ GLOBAL_LIST_INIT(meta_gas_info, meta_gas_list()) //see ATMOSPHERICS/gas_types.dm /datum/gas_mixture/proc/heat_capacity() //joules per kelvin var/list/cached_gases = gases - var/list/cached_gasinfo = GLOB.meta_gas_info + var/list/cached_gasheats = GLOB.meta_gas_specific_heats . = 0 for(var/id in cached_gases) - . += cached_gases[id] * cached_gasinfo[id][META_GAS_SPECIFIC_HEAT] //TODO - itll absolutely be worth splitting the meta_gas_info list into multiple lists to bypass the overhead associated with accessing lists within lists + . += cached_gases[id] * cached_gasheats[id] /datum/gas_mixture/turf/heat_capacity() . = ..() @@ -228,13 +237,15 @@ GLOBAL_LIST_INIT(meta_gas_info, meta_gas_list()) //see ATMOSPHERICS/gas_types.dm //we're gonna define these vars outside of this for loop because as it turns out, var declaration is pricy var/delta var/gas_heat_capacity + //and also cache this shit rq because that results in sanic speed for reasons byond explanation + var/list/cached_gasheats = GLOB.meta_gas_specific_heats //GAS TRANSFER for(var/id in cached_gases | sharer_gases) // transfer gases delta = QUANTIZE(cached_gases[id] - sharer_gases[id])/(atmos_adjacent_turfs+1) //the amount of gas that gets moved between the mixtures if(delta && abs_temperature_delta > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER) - gas_heat_capacity = delta * GLOB.meta_gas_info[id][META_GAS_SPECIFIC_HEAT] + gas_heat_capacity = delta * cached_gasheats[id] if(delta > 0) heat_capacity_self_to_sharer += gas_heat_capacity else diff --git a/code/modules/atmospherics/gasmixtures/gas_types.dm b/code/modules/atmospherics/gasmixtures/gas_types.dm index 9dcf8c3145..d628826b01 100644 --- a/code/modules/atmospherics/gasmixtures/gas_types.dm +++ b/code/modules/atmospherics/gasmixtures/gas_types.dm @@ -1,33 +1,66 @@ GLOBAL_LIST_INIT(hardcoded_gases, list(/datum/gas/oxygen, /datum/gas/nitrogen, /datum/gas/carbon_dioxide, /datum/gas/plasma)) //the main four gases, which were at one time hardcoded GLOBAL_LIST_INIT(nonreactive_gases, typecacheof(list(/datum/gas/oxygen, /datum/gas/nitrogen, /datum/gas/carbon_dioxide, /datum/gas/pluoxium, /datum/gas/stimulum, /datum/gas/nitryl))) //unable to react amongst themselves -/proc/meta_gas_list() - . = subtypesof(/datum/gas) - for(var/gas_path in .) - var/list/gas_info = new(7) - var/datum/gas/gas = gas_path - - gas_info[META_GAS_SPECIFIC_HEAT] = initial(gas.specific_heat) - gas_info[META_GAS_NAME] = initial(gas.name) - gas_info[META_GAS_MOLES_VISIBLE] = initial(gas.moles_visible) - if(initial(gas.moles_visible) != null) - gas_info[META_GAS_OVERLAY] = new /list(FACTOR_GAS_VISIBLE_MAX) - for(var/i in 1 to FACTOR_GAS_VISIBLE_MAX) - gas_info[META_GAS_OVERLAY][i] = new /obj/effect/overlay/gas(initial(gas.gas_overlay), i * 255 / FACTOR_GAS_VISIBLE_MAX) - gas_info[META_GAS_FUSION_POWER] = initial(gas.fusion_power) - gas_info[META_GAS_DANGER] = initial(gas.dangerous) - gas_info[META_GAS_ID] = initial(gas.id) - .[gas_path] = gas_info - /proc/gas_id2path(id) - var/list/meta_gas = GLOB.meta_gas_info + var/list/meta_gas = GLOB.meta_gas_ids if(id in meta_gas) return id for(var/path in meta_gas) - if(meta_gas[path][META_GAS_ID] == id) + if(meta_gas[path] == id) return path return "" +//Unomos - oh god oh fuck oh shit oh lord have mercy this is messy as fuck oh god +//my addiction to seeing better performance numbers isn't healthy, kids +//you see this shit, children? +//i am not a good idol. don't take after me. +//this is literally worse than my alcohol addiction +/proc/meta_gas_heat_list() + . = subtypesof(/datum/gas) + for(var/gas_path in .) + var/datum/gas/gas = gas_path + .[gas_path] = initial(gas.specific_heat) + +/proc/meta_gas_name_list() + . = subtypesof(/datum/gas) + for(var/gas_path in .) + var/datum/gas/gas = gas_path + .[gas_path] = initial(gas.name) + +/proc/meta_gas_visibility_list() + . = subtypesof(/datum/gas) + for(var/gas_path in .) + var/datum/gas/gas = gas_path + .[gas_path] = initial(gas.moles_visible) + +/proc/meta_gas_overlay_list() + . = subtypesof(/datum/gas) + for(var/gas_path in .) + var/datum/gas/gas = gas_path + .[gas_path] = 0 //gotta make sure if(GLOB.meta_gas_overlays[gaspath]) doesn't break + if(initial(gas.moles_visible) != null) + .[gas_path] = new /list(FACTOR_GAS_VISIBLE_MAX) + for(var/i in 1 to FACTOR_GAS_VISIBLE_MAX) + .[gas_path][i] = new /obj/effect/overlay/gas(initial(gas.gas_overlay), i * 255 / FACTOR_GAS_VISIBLE_MAX) + +/proc/meta_gas_danger_list() + . = subtypesof(/datum/gas) + for(var/gas_path in .) + var/datum/gas/gas = gas_path + .[gas_path] = initial(gas.dangerous) + +/proc/meta_gas_id_list() + . = subtypesof(/datum/gas) + for(var/gas_path in .) + var/datum/gas/gas = gas_path + .[gas_path] = initial(gas.id) + +/proc/meta_gas_fusion_list() + . = subtypesof(/datum/gas) + for(var/gas_path in .) + var/datum/gas/gas = gas_path + .[gas_path] = initial(gas.fusion_power) + /*||||||||||||||/----------\||||||||||||||*\ ||||||||||||||||[GAS DATUMS]|||||||||||||||| ||||||||||||||||\__________/|||||||||||||||| diff --git a/code/modules/atmospherics/gasmixtures/reactions.dm b/code/modules/atmospherics/gasmixtures/reactions.dm index e963582020..46ad4f26b7 100644 --- a/code/modules/atmospherics/gasmixtures/reactions.dm +++ b/code/modules/atmospherics/gasmixtures/reactions.dm @@ -228,7 +228,7 @@ var/old_heat_capacity = air.heat_capacity() var/reaction_energy = 0 - var/mediation = FUSION_MEDIATION_FACTOR*(air.heat_capacity()-(cached_gases[/datum/gas/plasma]*GLOB.meta_gas_info[/datum/gas/plasma][META_GAS_SPECIFIC_HEAT]))/(air.total_moles()-cached_gases[/datum/gas/plasma]) //This is the average specific heat of the mixture,not including plasma. + var/mediation = FUSION_MEDIATION_FACTOR*(air.heat_capacity()-(cached_gases[/datum/gas/plasma]*GLOB.meta_gas_specific_heats[/datum/gas/plasma]))/(air.total_moles()-cached_gases[/datum/gas/plasma]) //This is the average specific heat of the mixture,not including plasma. var/gases_fused = air.total_moles() - cached_gases[/datum/gas/plasma] var/plasma_differential = (cached_gases[/datum/gas/plasma] - gases_fused) / air.total_moles() @@ -236,7 +236,7 @@ var/gas_power = 0 for (var/gas_id in cached_gases) - gas_power += reaction_efficiency * (GLOB.meta_gas_info[gas_id][META_GAS_FUSION_POWER]*cached_gases[gas_id]) + gas_power += reaction_efficiency * (GLOB.meta_gas_fusions[gas_id]*cached_gases[gas_id]) var/power_ratio = gas_power/mediation cached_scan_results[id] = power_ratio //used for analyzer feedback diff --git a/code/modules/atmospherics/machinery/airalarm.dm b/code/modules/atmospherics/machinery/airalarm.dm index f065882a8d..6ea571935b 100644 --- a/code/modules/atmospherics/machinery/airalarm.dm +++ b/code/modules/atmospherics/machinery/airalarm.dm @@ -282,7 +282,7 @@ continue cur_tlv = TLV[gas_id] data["environment_data"] += list(list( - "name" = GLOB.meta_gas_info[gas_id][META_GAS_NAME], + "name" = GLOB.meta_gas_names[gas_id], "value" = environment.gases[gas_id] / total_moles * 100, "unit" = "%", "danger_level" = cur_tlv.get_danger_level(environment.gases[gas_id] * partial_pressure) @@ -352,11 +352,11 @@ thresholds[thresholds.len]["settings"] += list(list("env" = "temperature", "val" = "max1", "selected" = selected.max1)) thresholds[thresholds.len]["settings"] += list(list("env" = "temperature", "val" = "max2", "selected" = selected.max2)) - for(var/gas_id in GLOB.meta_gas_info) + for(var/gas_id in GLOB.meta_gas_names) if(!(gas_id in TLV)) // We're not interested in this gas, it seems. continue selected = TLV[gas_id] - thresholds += list(list("name" = GLOB.meta_gas_info[gas_id][META_GAS_NAME], "settings" = list())) + thresholds += list(list("name" = GLOB.meta_gas_names[gas_id], "settings" = list())) thresholds[thresholds.len]["settings"] += list(list("env" = gas_id, "val" = "min2", "selected" = selected.min2)) thresholds[thresholds.len]["settings"] += list(list("env" = gas_id, "val" = "min1", "selected" = selected.min1)) thresholds[thresholds.len]["settings"] += list(list("env" = gas_id, "val" = "max1", "selected" = selected.max1)) diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm index f045c2a10d..b073651a8e 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm @@ -190,9 +190,8 @@ data["filter_types"] = list() data["filter_types"] += list(list("name" = "Nothing", "path" = "", "selected" = !filter_type)) - for(var/path in GLOB.meta_gas_info) - var/list/gas = GLOB.meta_gas_info[path] - data["filter_types"] += list(list("name" = gas[META_GAS_NAME], "id" = gas[META_GAS_ID], "selected" = (path == gas_id2path(filter_type)))) + for(var/path in GLOB.meta_gas_ids) + data["filter_types"] += list(list("name" = GLOB.meta_gas_names[path], "id" = GLOB.meta_gas_ids[path], "selected" = (path == gas_id2path(filter_type)))) return data @@ -223,9 +222,9 @@ filter_type = null var/filter_name = "nothing" var/gas = gas_id2path(params["mode"]) - if(gas in GLOB.meta_gas_info) + if(gas in GLOB.meta_gas_names) filter_type = gas - filter_name = GLOB.meta_gas_info[gas][META_GAS_NAME] + filter_name = GLOB.meta_gas_names[gas] investigate_log("was set to filter [filter_name] by [key_name(usr)]", INVESTIGATE_ATMOS) . = TRUE update_icon() diff --git a/code/modules/atmospherics/machinery/components/unary_devices/tank.dm b/code/modules/atmospherics/machinery/components/unary_devices/tank.dm index 7aab990b18..4f16406456 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/tank.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/tank.dm @@ -18,7 +18,7 @@ air_contents.temperature = T20C if(gas_type) air_contents.gases[gas_type] = AIR_CONTENTS - name = "[name] ([GLOB.meta_gas_info[gas_type][META_GAS_NAME]])" + name = "[name] ([GLOB.meta_gas_names[gas_type]])" /obj/machinery/atmospherics/components/unary/tank/carbon_dioxide gas_type = /datum/gas/carbon_dioxide diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm index cd69f5b8c6..7f40630a86 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm @@ -120,9 +120,8 @@ return FALSE var/list/f_types = list() - for(var/path in GLOB.meta_gas_info) - var/list/gas = GLOB.meta_gas_info[path] - f_types += list(list("gas_id" = gas[META_GAS_ID], "gas_name" = gas[META_GAS_NAME], "enabled" = (path in filter_types))) + for(var/path in GLOB.meta_gas_ids) + f_types += list(list("gas_id" = GLOB.meta_gas_ids[path], "gas_name" = GLOB.meta_gas_names[path], "enabled" = (path in filter_types))) var/datum/signal/signal = new(list( "tag" = id_tag, diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm index 65fcb078d7..bad2b85bfe 100644 --- a/code/modules/atmospherics/machinery/portable/canister.dm +++ b/code/modules/atmospherics/machinery/portable/canister.dm @@ -437,10 +437,10 @@ var/list/danger = list() for(var/id in air_contents.gases) var/gas = air_contents.gases[id] - if(!GLOB.meta_gas_info[id][META_GAS_DANGER]) + if(!GLOB.meta_gas_dangers[id]) continue - if(gas > (GLOB.meta_gas_info[id][META_GAS_MOLES_VISIBLE] || MOLES_GAS_VISIBLE)) //if moles_visible is undefined, default to default visibility - danger[GLOB.meta_gas_info[id][META_GAS_NAME]] = gas //ex. "plasma" = 20 + if(gas > (GLOB.meta_gas_visibility[id] || MOLES_GAS_VISIBLE)) //if moles_visible is undefined, default to default visibility + danger[GLOB.meta_gas_names[id]] = gas //ex. "plasma" = 20 if(danger.len) message_admins("[ADMIN_LOOKUPFLW(usr)] opened a canister that contains the following at [ADMIN_VERBOSEJMP(src)]:") diff --git a/code/modules/atmospherics/machinery/portable/scrubber.dm b/code/modules/atmospherics/machinery/portable/scrubber.dm index 44ae465982..28cdb56e3d 100644 --- a/code/modules/atmospherics/machinery/portable/scrubber.dm +++ b/code/modules/atmospherics/machinery/portable/scrubber.dm @@ -78,9 +78,8 @@ data["id_tag"] = -1 //must be defined in order to reuse code between portable and vent scrubbers data["filter_types"] = list() - for(var/path in GLOB.meta_gas_info) - var/list/gas = GLOB.meta_gas_info[path] - data["filter_types"] += list(list("gas_id" = gas[META_GAS_ID], "gas_name" = gas[META_GAS_NAME], "enabled" = (path in scrubbing))) + for(var/path in GLOB.meta_gas_ids) + data["filter_types"] += list(list("gas_id" = GLOB.meta_gas_ids[path], "gas_name" = GLOB.meta_gas_names[path], "enabled" = (path in scrubbing))) if(holding) data["holding"] = list() diff --git a/code/modules/integrated_electronics/subtypes/atmospherics.dm b/code/modules/integrated_electronics/subtypes/atmospherics.dm index 7f1705e151..230d1ce154 100644 --- a/code/modules/integrated_electronics/subtypes/atmospherics.dm +++ b/code/modules/integrated_electronics/subtypes/atmospherics.dm @@ -371,7 +371,7 @@ obj/item/integrated_circuit/atmospherics/connector/portableConnectorReturnAir() for(var/filtered_gas in removed.gases) //Get the name of the gas and see if it is in the list - if(GLOB.meta_gas_info[filtered_gas][META_GAS_NAME] in wanted) + if(GLOB.meta_gas_names[filtered_gas] in wanted) //The gas that is put in all the filtered out gases filtered_out.temperature = removed.temperature filtered_out.gases[filtered_gas] = removed.gases[filtered_gas] diff --git a/code/modules/integrated_electronics/subtypes/input.dm b/code/modules/integrated_electronics/subtypes/input.dm index 040f4d1e4a..b9b83b54ea 100644 --- a/code/modules/integrated_electronics/subtypes/input.dm +++ b/code/modules/integrated_electronics/subtypes/input.dm @@ -1165,7 +1165,7 @@ var/list/gas_names = list() var/list/gas_amounts = list() for(var/id in gases) - var/name = GLOB.meta_gas_info[id][META_GAS_NAME] + var/name = GLOB.meta_gas_names[id] var/amt = round(gases[id], 0.001) gas_names.Add(name) gas_amounts.Add(amt) diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm index 2ab1c9da35..0e8d37a807 100644 --- a/code/modules/mob/living/silicon/pai/software.dm +++ b/code/modules/mob/living/silicon/pai/software.dm @@ -546,7 +546,7 @@ for(var/id in env_gases) var/gas_level = env_gases[id]/total_moles if(gas_level > 0.01) - dat += "[GLOB.meta_gas_info[id][META_GAS_NAME]]: [round(gas_level*100)]%
" + dat += "[GLOB.meta_gas_names[id]]: [round(gas_level*100)]%
" dat += "Temperature: [round(environment.temperature-T0C)]°C
" dat += "Refresh Reading
" dat += "
" diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index deefe00a9b..7ff8fbc0b1 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -68,7 +68,7 @@ for(var/id in environment.gases) var/gas = environment.gases[id] if(gas) - t+="[GLOB.meta_gas_info[id][META_GAS_NAME]]: [gas] \n" + t+="[GLOB.meta_gas_names[id]]: [gas] \n" to_chat(usr, t) diff --git a/code/modules/modular_computers/file_system/programs/sm_monitor.dm b/code/modules/modular_computers/file_system/programs/sm_monitor.dm index ca451beec4..e7dd42a797 100644 --- a/code/modules/modular_computers/file_system/programs/sm_monitor.dm +++ b/code/modules/modular_computers/file_system/programs/sm_monitor.dm @@ -81,13 +81,13 @@ if(air.total_moles()) for(var/gasid in air.gases) gasdata.Add(list(list( - "name"= GLOB.meta_gas_info[gasid][META_GAS_NAME], + "name"= GLOB.meta_gas_names[gasid], "amount" = round(100*air.gases[gasid]/air.total_moles(),0.01)))) else for(var/gasid in air.gases) gasdata.Add(list(list( - "name"= GLOB.meta_gas_info[gasid][META_GAS_NAME], + "name"= GLOB.meta_gas_names[gasid], "amount" = 0))) data["gases"] = gasdata diff --git a/modular_citadel/code/modules/mob/living/silicon/robot/dogborg_equipment.dm b/modular_citadel/code/modules/mob/living/silicon/robot/dogborg_equipment.dm index 511cd9abfb..5e10e71433 100644 --- a/modular_citadel/code/modules/mob/living/silicon/robot/dogborg_equipment.dm +++ b/modular_citadel/code/modules/mob/living/silicon/robot/dogborg_equipment.dm @@ -120,7 +120,7 @@ SLEEPER CODE IS IN game/objects/items/devices/dogborg_sleeper.dm ! if(id in GLOB.hardcoded_gases) continue var/gas_concentration = env_gases[id]/total_moles - to_chat(user, "[GLOB.meta_gas_info[id][META_GAS_NAME]]: [round(gas_concentration*100, 0.01)] %") + to_chat(user, "[GLOB.meta_gas_names[id]]: [round(gas_concentration*100, 0.01)] %") to_chat(user, "Temperature: [round(environment.temperature-T0C)] °C") /obj/item/analyzer/nose/AltClick(mob/user) //Barometer output for measuring when the next storm happens