From ba6d08d5ebf35810eb6f2a44091b48dbf65285be Mon Sep 17 00:00:00 2001 From: Ghilker <42839747+Ghilker@users.noreply.github.com> Date: Sun, 4 Apr 2021 20:53:04 +0200 Subject: [PATCH] Injectors, vents and scrubbers no longer work when placed on walls (#57971) fixes gas deletion exploit by stopping injectors, vents and scrubbers from being placed on walls --- .../machinery/components/binary_devices/dp_vent_pump.dm | 5 +++++ .../machinery/components/unary_devices/outlet_injector.dm | 6 +++++- .../machinery/components/unary_devices/passive_vent.dm | 6 ++++-- .../machinery/components/unary_devices/vent_pump.dm | 1 - .../machinery/components/unary_devices/vent_scrubber.dm | 6 ++++-- 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm index b8b90d01ef4..4740d4bb203 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm @@ -51,6 +51,11 @@ /obj/machinery/atmospherics/components/binary/dp_vent_pump/process_atmos() if(!on) return + + var/turf/location = get_turf(loc) + if(isclosedturf(location)) + return + var/datum/gas_mixture/air1 = airs[1] var/datum/gas_mixture/air2 = airs[2] diff --git a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm index c6331a0d16f..07fbbfe78a7 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm @@ -61,6 +61,10 @@ if(!on || !is_operational) return + var/turf/location = get_turf(loc) + if(isclosedturf(location)) + return + var/datum/gas_mixture/air_contents = airs[1] if(air_contents.temperature > 0) @@ -68,7 +72,7 @@ var/datum/gas_mixture/removed = air_contents.remove(transfer_moles) - loc.assume_air(removed) + location.assume_air(removed) air_update_turf(FALSE, FALSE) update_parents() diff --git a/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm b/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm index df116cd34ce..7adb2f7532c 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm @@ -20,9 +20,11 @@ icon_state = "passive_vent" /obj/machinery/atmospherics/components/unary/passive_vent/process_atmos() - ..() + var/turf/location = get_turf(loc) + if(isclosedturf(location)) + return - var/datum/gas_mixture/external = loc.return_air() + var/datum/gas_mixture/external = location.return_air() var/datum/gas_mixture/internal = airs[1] if(internal.equalize(external)) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm index def92834c46..afe846fd5ba 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm @@ -88,7 +88,6 @@ icon_state = "vent_in" /obj/machinery/atmospherics/components/unary/vent_pump/process_atmos() - ..() if(!is_operational) return if(!nodes[1]) 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 ae3a402a39c..aa551bc26de 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm @@ -138,13 +138,15 @@ ..() /obj/machinery/atmospherics/components/unary/vent_scrubber/process_atmos() - ..() if(welded || !is_operational) return FALSE if(!nodes[1] || !on) on = FALSE return FALSE - scrub(loc) + var/turf/open/us = loc + if(!istype(us)) + return + scrub(us) if(widenet) for(var/turf/tile in adjacent_turfs) scrub(tile)