From 6df56a2cf88c513e16791f09b864d2fb1c6b914b Mon Sep 17 00:00:00 2001 From: Putnam Date: Sat, 25 Jan 2020 18:31:53 -0800 Subject: [PATCH] properly fixed flags, also made it close on one side's pressure --- .../machinery/components/binary_devices/relief_valve.dm | 7 ++++--- .../machinery/components/unary_devices/relief_valve.dm | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/code/modules/atmospherics/machinery/components/binary_devices/relief_valve.dm b/code/modules/atmospherics/machinery/components/binary_devices/relief_valve.dm index 694a9b53c3..bc58ef158f 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/relief_valve.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/relief_valve.dm @@ -5,7 +5,7 @@ icon_state = "relief_valve-t-map" can_unwrench = TRUE construction_type = /obj/item/pipe/binary - interaction_flags_machine = INTERACT_MACHINE_OFFLINE + interaction_flags_machine = INTERACT_MACHINE_OFFLINE | INTERACT_MACHINE_WIRES_IF_OPEN | INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OPEN_SILICON | INTERACT_MACHINE_SET_MACHINE var/opened = FALSE var/open_pressure = ONE_ATMOSPHERE * 3 var/close_pressure = ONE_ATMOSPHERE @@ -53,8 +53,9 @@ var/datum/gas_mixture/air_one = airs[1] var/datum/gas_mixture/air_two = airs[2] - var/our_pressure = abs(air_one.return_pressure() - air_two.return_pressure()) - if(opened && our_pressure < close_pressure) + var/air_one_pressure = air_one.return_pressure() + var/our_pressure = abs(air_one_pressure - air_two.return_pressure()) + if(opened && air_one_pressure < close_pressure) close() else if(!opened && our_pressure >= open_pressure) open() diff --git a/code/modules/atmospherics/machinery/components/unary_devices/relief_valve.dm b/code/modules/atmospherics/machinery/components/unary_devices/relief_valve.dm index 9028c9e849..4b6a4a4c10 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/relief_valve.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/relief_valve.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/atmospherics/components/relief_valve.dmi' icon_state = "relief_valve-e-map" can_unwrench = TRUE - interaction_flags_machine = INTERACT_MACHINE_OFFLINE + interaction_flags_machine = INTERACT_MACHINE_OFFLINE | INTERACT_MACHINE_WIRES_IF_OPEN | INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OPEN_SILICON | INTERACT_MACHINE_SET_MACHINE var/opened = FALSE var/open_pressure = ONE_ATMOSPHERE * 3 var/close_pressure = ONE_ATMOSPHERE