From 6ba803b396d7c0bf7034c4852f775dbfcb69cc19 Mon Sep 17 00:00:00 2001 From: duncathan Date: Fri, 14 Aug 2015 22:50:44 -0600 Subject: [PATCH] fixes is_bent and stored not being created/set properly --- code/ATMOSPHERICS/atmospherics.dm | 12 +++----- code/game/machinery/pipe/construction.dm | 39 ++++++++++++------------ 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index da0d268b47a..8291334eb8d 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -163,13 +163,11 @@ Pipelines + Other Objects -> Pipe network return img -/obj/machinery/atmospherics/construction(D, P, pipe_type, obj_color) - if(can_unwrench) - color = obj_color - pipe_color = obj_color - stored.dir = src.dir //need to define them here, because the obj directions... - stored.pipe_type = pipe_type //... were not set at the time the stored pipe was created - stored.color = obj_color +/obj/machinery/atmospherics/construction(obj/item/pipe/pipe_item) + if(can_unwrench && pipe_item) + color = pipe_item.color + pipe_color = pipe_item.color + stored = pipe_item var/turf/T = loc level = T.intact ? 2 : 1 atmosinit() diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index bd46cb951f0..4390f089099 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -89,10 +89,11 @@ Buildable meters if(!(pipe_type in pipe_types)) for(var/P in pipe_types) - if(istype(pipe_type, P)) + if(ispath(pipe_type, P)) pipe_type = P + break - if(!(make_from.initialize_directions in list(NORTH|SOUTH, WEST|EAST)) && src.pipe_type in list(PIPE_SIMPLE, PIPE_HE)) + if(!(src.dir in cardinal)) is_bent = 1 update() @@ -101,25 +102,25 @@ Buildable meters //update the name and icon of the pipe item depending on the type var/global/list/pipeID2State = list( - "[PIPE_SIMPLE]" = "simple", \ - "[PIPE_MANIFOLD]" = "manifold", \ - "[PIPE_4WAYMANIFOLD]" = "manifold4w", \ - "[PIPE_HE]" = "he", \ - "[PIPE_JUNCTION]" = "junction", \ + "[PIPE_SIMPLE]" = "simple", \ + "[PIPE_MANIFOLD]" = "manifold", \ + "[PIPE_4WAYMANIFOLD]" = "manifold4w", \ + "[PIPE_HE]" = "he", \ + "[PIPE_JUNCTION]" = "junction", \ \ - "[PIPE_CONNECTOR]" = "connector", \ - "[PIPE_UVENT]" = "uvent", \ - "[PIPE_SCRUBBER]" = "scrubber", \ - "[PIPE_HEAT_EXCHANGE]" = "heunary", \ + "[PIPE_CONNECTOR]" = "connector", \ + "[PIPE_UVENT]" = "uvent", \ + "[PIPE_SCRUBBER]" = "scrubber", \ + "[PIPE_HEAT_EXCHANGE]" = "heunary", \ \ - "[PIPE_PUMP]" = "pump", \ - "[PIPE_PASSIVE_GATE]" = "passivegate", \ - "[PIPE_VOLUME_PUMP]" = "volumepump", \ - "[PIPE_MVALVE]" = "mvalve", \ - "[PIPE_DVALVE]" = "dvalve", \ + "[PIPE_PUMP]" = "pump", \ + "[PIPE_PASSIVE_GATE]" = "passivegate", \ + "[PIPE_VOLUME_PUMP]" = "volumepump", \ + "[PIPE_MVALVE]" = "mvalve", \ + "[PIPE_DVALVE]" = "dvalve", \ \ - "[PIPE_GAS_FILTER]" = "filter", \ - "[PIPE_GAS_MIXER]" = "mixer", \ + "[PIPE_GAS_FILTER]" = "filter", \ + "[PIPE_GAS_MIXER]" = "mixer", \ ) /obj/item/pipe/proc/update() @@ -311,7 +312,7 @@ var/global/list/pipeID2State = list( if(istype(T)) T.flipped = flipped - A.construction(pipe_type, color) + A.construction(src) /* switch(pipe_type)