diff --git a/code/__DEFINES/atmospherics.dm b/code/__DEFINES/atmospherics.dm index c27336bf890c6..29f901529f7aa 100644 --- a/code/__DEFINES/atmospherics.dm +++ b/code/__DEFINES/atmospherics.dm @@ -538,12 +538,6 @@ GLOBAL_LIST_INIT(pipe_paint_colors, sortList(list( out_var += cached_gases[total_moles_id][MOLES];\ } -#define TOTAL_MOLES_SPECIFIC(cached_gases, gas_id, out_var)\ - out_var = 0;\ - if(cached_gases[gas_id]){\ - out_var = cached_gases[gas_id][MOLES];\ - } - #ifdef TESTING GLOBAL_LIST_INIT(atmos_adjacent_savings, list(0,0)) #define CALCULATE_ADJACENT_TURFS(T, state) if (SSadjacent_air.queue[T]) { GLOB.atmos_adjacent_savings[1] += 1 } else { GLOB.atmos_adjacent_savings[2] += 1; SSadjacent_air.queue[T] = state} diff --git a/code/modules/atmospherics/gasmixtures/gas_mixture.dm b/code/modules/atmospherics/gasmixtures/gas_mixture.dm index 360ee2645ed86..5f1b3fe0ff678 100644 --- a/code/modules/atmospherics/gasmixtures/gas_mixture.dm +++ b/code/modules/atmospherics/gasmixtures/gas_mixture.dm @@ -106,12 +106,7 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache()) /datum/gas_mixture/proc/total_moles() var/cached_gases = gases TOTAL_MOLES(cached_gases, .) - -/// Calculate moles for a specific gas in the mixture -/datum/gas_mixture/proc/total_moles_specific(gas_id) - var/cached_gases = gases - TOTAL_MOLES_SPECIFIC(cached_gases, gas_id, .) - + /// Checks to see if gas amount exists in mixture. /// Do NOT use this in code where performance matters! /// It's better to batch calls to garbage_collect(), especially in places where you're checking many gastypes diff --git a/code/modules/atmospherics/machinery/bluespace_vendor.dm b/code/modules/atmospherics/machinery/bluespace_vendor.dm index dfd0b07cbf555..d8ffb232ffa5d 100644 --- a/code/modules/atmospherics/machinery/bluespace_vendor.dm +++ b/code/modules/atmospherics/machinery/bluespace_vendor.dm @@ -183,8 +183,9 @@ ///Check the price of the current tank, if the user doesn't have the money the gas will be merged back into the network /obj/machinery/bluespace_vendor/proc/check_price(mob/user) var/temp_price = 0 - for(var/gas_id in internal_tank.air_contents.gases) - temp_price += internal_tank.air_contents.total_moles_specific(gas_id) * connected_machine.base_prices[gas_id] + var/list/gases = internal_tank.air_contents.gases + for(var/gas_id in gases) + temp_price += gases[gas_id][MOLES] * connected_machine.base_prices[gas_id] gas_price = temp_price if(attempt_charge(src, user, gas_price) & COMPONENT_OBJ_CANCEL_CHARGE)