From 8bacdd2b71fdf2e0db36c075663c8729fc3c1a18 Mon Sep 17 00:00:00 2001 From: SyncIt21 <110812394+SyncIt21@users.noreply.github.com> Date: Thu, 12 Feb 2026 00:37:53 +0530 Subject: [PATCH] [NO GBP] Allows plumbing machines on ducts with different layers (#95052) ## About The Pull Request - Closes #95039. Although intentionally removed in #94678 the inconvenience of not allowing ducts under machines of different layers isn't worth the visual clutter it has helped in reducing so I'm bringing it back ## Changelog :cl: qol: you can place plumbing machines on ducts with different layers again /:cl: --- code/__HELPERS/plumbing.dm | 16 +++++++++++----- code/datums/components/plumbing/_plumbing.dm | 2 +- code/game/objects/items/rcd/RPLD.dm | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/code/__HELPERS/plumbing.dm b/code/__HELPERS/plumbing.dm index a16e861cba9..918650b6606 100644 --- a/code/__HELPERS/plumbing.dm +++ b/code/__HELPERS/plumbing.dm @@ -3,20 +3,26 @@ * * Arguments * * atom/destination - the target loc we are checking for - * * ducting_layer - the ducting layer to check for. Pass 0 to ignore all layer checks + * * ducting_layer - the ducting layer to check for. pass -ve value when you are checking for overlapping machines */ /proc/ducting_layer_check(atom/destination, ducting_layer) . = null - for(var/obj/machinery/other in get_turf(destination)) + + var/is_machine = FALSE + if(ducting_layer < 0) + is_machine = TRUE + ducting_layer = abs(ducting_layer) + + for(var/atom/movable/other in get_turf(destination)) if(other == destination) continue //check for overlapping ducts var/obj/machinery/duct/pipe = other - if(istype(pipe) && (!ducting_layer || (pipe.duct_layer & ducting_layer))) + if(istype(pipe) && (pipe.duct_layer & ducting_layer)) return pipe - //check for overlapping machines. Only allow machines to overlap during ci testing which should be fixed in the future + //check for overlapping machines. -ve duct layer means we are checking machines on machines overlap which regardless of layer is not allowed for(var/datum/component/plumbing/plumber as anything in other.GetComponents(/datum/component/plumbing)) - if(!PERFORM_ALL_TESTS(maptest_log_mapping) || (plumber.ducting_layer & ducting_layer)) + if(is_machine || (plumber.ducting_layer & ducting_layer)) return plumber diff --git a/code/datums/components/plumbing/_plumbing.dm b/code/datums/components/plumbing/_plumbing.dm index 716f8e0ccd2..284d2eb068d 100644 --- a/code/datums/components/plumbing/_plumbing.dm +++ b/code/datums/components/plumbing/_plumbing.dm @@ -140,7 +140,7 @@ SIGNAL_HANDLER if(!active()) - var/datum/overlap = ducting_layer_check(parent_obj) + var/datum/overlap = ducting_layer_check(parent_obj, -ducting_layer) if(!isnull(overlap)) parent_obj.balloon_alert(user, "overlapping [istype(overlap, /obj/machinery/duct) ? "duct" : "machine"] detected!") return ITEM_INTERACT_FAILURE diff --git a/code/game/objects/items/rcd/RPLD.dm b/code/game/objects/items/rcd/RPLD.dm index 3c1f916ab14..2a6ace7783e 100644 --- a/code/game/objects/items/rcd/RPLD.dm +++ b/code/game/objects/items/rcd/RPLD.dm @@ -221,7 +221,7 @@ return FALSE if(initial(blueprint.density) && destination.is_blocked_turf(exclude_mobs = FALSE, source_atom = null, ignore_atoms = null)) return FALSE - return isnull(ducting_layer_check(destination, ispath(blueprint, /obj/machinery/duct) ? GLOB.plumbing_layers[current_layer] : NONE)) + return isnull(ducting_layer_check(destination, (ispath(blueprint, /obj/machinery/duct) ? 1 : -1) * GLOB.plumbing_layers[current_layer])) /obj/item/construction/plumbing/interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers) . = ..()