diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index 4dfe8d70812..a7fe9ddd537 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -41,11 +41,14 @@ Pipelines + Other Objects -> Pipe network if(!pipe_color_check(pipe_color)) pipe_color = null + ..() + +/obj/machinery/atmospherics/initialize() + ..() + if(can_unwrench) stored = new(src, make_from = src) - ..() - /obj/machinery/atmospherics/Destroy() for(var/mob/living/M in src) //ventcrawling is serious business M.remove_ventcrawl() @@ -210,7 +213,7 @@ Pipelines + Other Objects -> Pipe network dir = D initialize_directions = P var/turf/T = loc - level = T.intact ? 2 : 1 + level = T.intact ? 2 : 1 initialize() var/list/nodes = pipeline_expansion() for(var/obj/machinery/atmospherics/A in nodes) diff --git a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm index b546268b4e0..343501dfd28 100644 --- a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm +++ b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm @@ -42,6 +42,7 @@ return ..() /obj/machinery/atmospherics/binary/initialize() + ..() var/node2_connect = dir var/node1_connect = turn(dir, 180) diff --git a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm index 55216a5a5c2..f1241079ad3 100644 --- a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm +++ b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm @@ -57,6 +57,7 @@ return ..() /obj/machinery/atmospherics/omni/initialize() + ..() for(var/datum/omni_port/P in ports) if(P.node || P.mode == 0) continue diff --git a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm index a008b8886d5..9824715c1f4 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm @@ -67,7 +67,7 @@ return ..() /obj/machinery/atmospherics/trinary/initialize() - + ..() //Mixer: //1 and 2 is input //Node 3 is output @@ -78,10 +78,6 @@ //Node 2 is filtered output //Node 3 is rest output //If we flip the filter, 1 and 3 shall exchange positions - - if(can_unwrench) // Overridden here to avoid having to snowflake the flipped/icon_state on the construction - qdel(stored) - stored = new(src, make_from = src) var/node1_connect = turn(dir, -180) var/node2_connect = turn(dir, -90) diff --git a/code/ATMOSPHERICS/components/unary_devices/unary_base.dm b/code/ATMOSPHERICS/components/unary_devices/unary_base.dm index 76bd3ddc8c7..15b254093f9 100644 --- a/code/ATMOSPHERICS/components/unary_devices/unary_base.dm +++ b/code/ATMOSPHERICS/components/unary_devices/unary_base.dm @@ -23,6 +23,7 @@ return ..() /obj/machinery/atmospherics/unary/initialize() + ..() for(var/obj/machinery/atmospherics/target in get_step(src, dir)) if(target.initialize_directions & get_dir(target,src)) var/c = check_connect_types(target,src) diff --git a/code/ATMOSPHERICS/pipes/cap.dm b/code/ATMOSPHERICS/pipes/cap.dm index 6f70cf52465..35916a5b575 100644 --- a/code/ATMOSPHERICS/pipes/cap.dm +++ b/code/ATMOSPHERICS/pipes/cap.dm @@ -62,6 +62,7 @@ overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "cap" + icon_connect_type) /obj/machinery/atmospherics/pipe/cap/initialize() + ..() for(var/obj/machinery/atmospherics/target in get_step(src, dir)) if(target.initialize_directions & get_dir(target,src)) var/c = check_connect_types(target,src) diff --git a/code/ATMOSPHERICS/pipes/manifold.dm b/code/ATMOSPHERICS/pipes/manifold.dm index 555ee66dbfd..6e6a8569ad9 100644 --- a/code/ATMOSPHERICS/pipes/manifold.dm +++ b/code/ATMOSPHERICS/pipes/manifold.dm @@ -33,6 +33,7 @@ icon = null /obj/machinery/atmospherics/pipe/manifold/initialize() + ..() for(var/D in cardinal) if(D == dir) continue diff --git a/code/ATMOSPHERICS/pipes/manifold4w.dm b/code/ATMOSPHERICS/pipes/manifold4w.dm index 8f8b8460486..be0019a43a2 100644 --- a/code/ATMOSPHERICS/pipes/manifold4w.dm +++ b/code/ATMOSPHERICS/pipes/manifold4w.dm @@ -152,6 +152,7 @@ update_icon() /obj/machinery/atmospherics/pipe/manifold4w/initialize() + ..() for(var/D in cardinal) for(var/obj/machinery/atmospherics/target in get_step(src, D)) if(target.initialize_directions & get_dir(target,src)) diff --git a/code/ATMOSPHERICS/pipes/simple/pipe_simple.dm b/code/ATMOSPHERICS/pipes/simple/pipe_simple.dm index 7908acc5321..c3d1762b993 100644 --- a/code/ATMOSPHERICS/pipes/simple/pipe_simple.dm +++ b/code/ATMOSPHERICS/pipes/simple/pipe_simple.dm @@ -44,6 +44,7 @@ initialize_directions = SOUTH|WEST /obj/machinery/atmospherics/pipe/simple/initialize() + ..() normalize_dir() var/N = 2 for(var/D in cardinal) diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 667602686b5..47bbfa2715f 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -164,7 +164,7 @@ src.color = PIPE_COLOR_RED else if (pipe_type == PIPE_UNIVERSAL) connect_types = list(1,2,3) - //src.pipe_dir = get_pipe_dir() + update(make_from) src.pixel_x = rand(-5, 5) src.pixel_y = rand(-5, 5) @@ -275,14 +275,8 @@ src.dir = turn(src.dir, -90) - if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SUPPLY_STRAIGHT, PIPE_SCRUBBERS_STRAIGHT, PIPE_UNIVERSAL, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE, PIPE_DVALVE)) - if(dir==2) - dir = 1 - else if(dir==8) - dir = 4 - else if (pipe_type in list (PIPE_MANIFOLD4W, PIPE_SUPPLY_MANIFOLD4W, PIPE_SCRUBBERS_MANIFOLD4W)) - dir = 2 - //src.pipe_dir = get_pipe_dir() + fixdir() + return /obj/item/pipe/verb/flip() @@ -406,22 +400,6 @@ //Helper to clean up dir /obj/item/pipe/proc/fixdir() - if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE, PIPE_DVALVE)) - if(dir==2) - dir = 1 - else if(dir==8) - dir = 4 - -/obj/item/pipe/attack_self(mob/user as mob) - return rotate() - -/obj/item/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) - ..() - //* - if (!istype(W, /obj/item/weapon/wrench)) - return ..() - if (!isturf(src.loc)) - return 1 if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SUPPLY_STRAIGHT, PIPE_SCRUBBERS_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE, PIPE_DVALVE)) if(dir==2) dir = 1 @@ -429,13 +407,27 @@ dir = 4 else if (pipe_type in list(PIPE_MANIFOLD4W, PIPE_SUPPLY_MANIFOLD4W, PIPE_SCRUBBERS_MANIFOLD4W, PIPE_OMNI_MIXER, PIPE_OMNI_FILTER)) dir = 2 + +/obj/item/pipe/attack_self(mob/user as mob) + return rotate() + +/obj/item/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) + ..() + + if (!istype(W, /obj/item/weapon/wrench)) + return ..() + + if (!isturf(src.loc)) + return 1 + + fixdir() + var/pipe_dir = get_pipe_dir() for(var/obj/machinery/atmospherics/M in src.loc) if((M.initialize_directions & pipe_dir) && M.check_connect_types_construction(M,src)) // matches at least one direction on either type of pipe - user << "\red There is already a pipe of the same type at this location." + user << "There is already a pipe of the same type at this location." return 1 - // no conflicts found var/obj/machinery/atmospherics/machineReference = null //If somebody wants to overhaul that switch statement below, be my guest. Easier to set a reference here and then transfer logs after the switch statement. @@ -603,11 +595,6 @@ qdel(src) // remove the pipe item return - //TODO: DEFERRED - -// ensure that setterm() is called for a newly connected pipeline - - /obj/item/pipe_meter name = "meter"