<commit_before>obj/machinery/atmospherics/trinary/filter
	icon = 'icons/obj/atmospherics/filter.dmi'
	icon_state = "intact_off"
	density = 1

	name = "Gas filter"

	req_access = list(access_atmospherics)

	var/on = 0
	var/temp = null // -- TLE

	var/target_pressure = ONE_ATMOSPHERE

	var/filter_type = 0
/*
Filter types:
-1: Nothing
 0: Carbon Molecules: Plasma Toxin, Oxygen Agent B
 1: Oxygen: Oxygen ONLY
 2: Nitrogen: Nitrogen ONLY
 3: Carbon Dioxide: Carbon Dioxide ONLY
 4: Sleeping Agent (N2O)
*/

	var/frequency = 0
	var/datum/radio_frequency/radio_connection

	proc
		set_frequency(new_frequency)
			radio_controller.remove_object(src, frequency)
			frequency = new_frequency
			if(frequency)
				radio_connection = radio_controller.add_object(src, frequency, RADIO_ATMOSIA)

	New()
		if(radio_controller)
			initialize()
		..()

	update_icon()
		if(stat & NOPOWER)
			icon_state = "intact_off"
		else if(node2 && node3 && node1)
			icon_state = "intact_[on?("on"):("off")]"
		else
			icon_state = "intact_off"
			on = 0

		return

	power_change()
		var/old_stat = stat
		..()
		if(old_stat != stat)
			update_icon()

	process()
		..()
		if(!on)
			return 0

		var/output_starting_pressure = air3.return_pressure()

		if(output_starting_pressure >= target_pressure)
			//No need to mix if target is already full!
			return 1

		//Calculate necessary moles to transfer using PV=nRT

		var/pressure_delta = target_pressure - output_starting_pressure
		var/transfer_moles

		if(air1.temperature > 0)
			transfer_moles = pressure_delta*air3.volume/(air1.temperature * R_IDEAL_GAS_EQUATION)

		//Actually transfer the gas

		if(transfer_moles > 0)<commit_msg>Fixes the bug with Filters allowing insane overpressurization.<commit_after>obj/machinery/atmospherics/trinary/filter
	icon = 'icons/obj/atmospherics/filter.dmi'
	icon_state = "intact_off"
	density = 1

	name = "Gas filter"

	req_access = list(access_atmospherics)

	var/on = 0
	var/temp = null // -- TLE

	var/target_pressure = ONE_ATMOSPHERE

	var/filter_type = 0
/*
Filter types:
-1: Nothing
 0: Carbon Molecules: Plasma Toxin, Oxygen Agent B
 1: Oxygen: Oxygen ONLY
 2: Nitrogen: Nitrogen ONLY
 3: Carbon Dioxide: Carbon Dioxide ONLY
 4: Sleeping Agent (N2O)
*/

	var/frequency = 0
	var/datum/radio_frequency/radio_connection

	proc
		set_frequency(new_frequency)
			radio_controller.remove_object(src, frequency)
			frequency = new_frequency
			if(frequency)
				radio_connection = radio_controller.add_object(src, frequency, RADIO_ATMOSIA)

	New()
		if(radio_controller)
			initialize()
		..()

	update_icon()
		if(stat & NOPOWER)
			icon_state = "intact_off"
		else if(node2 && node3 && node1)
			icon_state = "intact_[on?("on"):("off")]"
		else
			icon_state = "intact_off"
			on = 0

		return

	power_change()
		var/old_stat = stat
		..()
		if(old_stat != stat)
			update_icon()

	process()
		..()
		if(!on)
			return 0

		var/output_starting_pressure = air3.return_pressure()

		if(output_starting_pressure >= target_pressure || air2.return_pressure() >= target_pressure )
			//No need to mix if target is already full!
			return 1

		//Calculate necessary moles to transfer using PV=nRT

		var/pressure_delta = target_pressure - output_starting_pressure
		var/transfer_moles

		if(air1.temperature > 0)
			transfer_moles = pressure_delta*air3.volume/(air1.temperature * R_IDEAL_GAS_EQUATION)

		//Actually transfer the gas

		if(transfer_moles > 0)
{'fraction_non_alphanumeric': 0.10575518550978674, 'fraction_numerical': 0.013730645632486124, 'mean_word_length': 3.969521044992743, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4225653', 'n_tokens_mistral': 1427, 'n_tokens_neox': 1199, 'n_words': 272}