From 02b57d42ba9bb3da8e6577a673397aa97fe7d685 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Fri, 5 Mar 2021 15:00:42 +0100 Subject: [PATCH] [MIRROR] Fix multiz piping issue (#3885) * Fix multiz piping issue (#57273) Fixes multiz adapters, now they work on the same tile with different pipe layers and they keep the pipelines separated. Comes with a sprite fix due to layer 1 and 5 miscalculations * Fix multiz piping issue Co-authored-by: Ghilker <42839747+Ghilker@users.noreply.github.com> --- code/game/objects/items/RPD.dm | 2 +- .../atmospherics/machinery/pipes/multiz.dm | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/code/game/objects/items/RPD.dm b/code/game/objects/items/RPD.dm index 52b9ce97b74..12a0cdcdfcd 100644 --- a/code/game/objects/items/RPD.dm +++ b/code/game/objects/items/RPD.dm @@ -19,7 +19,7 @@ GLOBAL_LIST_INIT(atmos_pipe_recipes, list( new /datum/pipe_info/pipe("Manifold", /obj/machinery/atmospherics/pipe/manifold, TRUE), new /datum/pipe_info/pipe("4-Way Manifold", /obj/machinery/atmospherics/pipe/manifold4w, TRUE), new /datum/pipe_info/pipe("Layer Adapter", /obj/machinery/atmospherics/pipe/layer_manifold, TRUE), - new /datum/pipe_info/pipe("Multi-Deck Adapter", /obj/machinery/atmospherics/pipe/multiz, TRUE), + new /datum/pipe_info/pipe("Multi-Deck Adapter", /obj/machinery/atmospherics/pipe/multiz, FALSE), ), "Devices" = list( new /datum/pipe_info/pipe("Connector", /obj/machinery/atmospherics/components/unary/portables_connector, TRUE), diff --git a/code/modules/atmospherics/machinery/pipes/multiz.dm b/code/modules/atmospherics/machinery/pipes/multiz.dm index 60246239c07..cce990ab11e 100644 --- a/code/modules/atmospherics/machinery/pipes/multiz.dm +++ b/code/modules/atmospherics/machinery/pipes/multiz.dm @@ -43,15 +43,14 @@ center.pixel_x = PIPING_LAYER_P_X * (piping_layer - PIPING_LAYER_DEFAULT) . += center - ///Attempts to locate a multiz pipe that's above us, if it finds one it merges us into its pipenet /obj/machinery/atmospherics/pipe/multiz/pipeline_expansion() var/turf/T = get_turf(src) - var/obj/machinery/atmospherics/pipe/multiz/above = locate(/obj/machinery/atmospherics/pipe/multiz) in(SSmapping.get_turf_above(T)) - var/obj/machinery/atmospherics/pipe/multiz/below = locate(/obj/machinery/atmospherics/pipe/multiz) in(SSmapping.get_turf_below(T)) - if(below) - below.pipeline_expansion() //If we've got one below us, force it to add us on facebook - if(above) - nodes += above - above.nodes += src //Two way travel :) + for(var/obj/machinery/atmospherics/pipe/multiz/above in SSmapping.get_turf_above(T)) + if(above.piping_layer == piping_layer) + nodes += above + above.nodes += src //Two way travel :) + for(var/obj/machinery/atmospherics/pipe/multiz/below in SSmapping.get_turf_below(T)) + if(below.piping_layer == piping_layer) + below.pipeline_expansion() //If we've got one below us, force it to add us on facebook return ..()