From 493ecdeb9e1d5f5be9ecd56deca8848829dd0134 Mon Sep 17 00:00:00 2001 From: Loganbacca Date: Tue, 24 Jun 2014 18:26:37 +1200 Subject: [PATCH] Pipe fixes - Cleans up silent pipe deleting (now creates a loose pipe item where the pipe section was) - Allows pipe painters to paint disconnected pipes - Removes OOC message from IC feedback --- code/ATMOSPHERICS/pipes.dm | 34 +++++++++++++++--------- code/game/machinery/pipe/construction.dm | 2 +- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/code/ATMOSPHERICS/pipes.dm b/code/ATMOSPHERICS/pipes.dm index c1fa2b0e9e4..11daee64c3d 100644 --- a/code/ATMOSPHERICS/pipes.dm +++ b/code/ATMOSPHERICS/pipes.dm @@ -220,15 +220,16 @@ obj/machinery/atmospherics/pipe/simple/pipeline_expansion() return list(node1, node2) obj/machinery/atmospherics/pipe/simple/update_icon() - if(node1&&node2) - switch(pipe_color) - if ("red") color = COLOR_RED - if ("blue") color = COLOR_BLUE - if ("cyan") color = COLOR_CYAN - if ("green") color = COLOR_GREEN - if ("yellow") color = "#FFCC00" - if ("purple") color = "#5C1EC0" - if ("grey") color = null + switch(pipe_color) + if ("red") color = COLOR_RED + if ("blue") color = COLOR_BLUE + if ("cyan") color = COLOR_CYAN + if ("green") color = COLOR_GREEN + if ("yellow") color = "#FFCC00" + if ("purple") color = "#5C1EC0" + if ("grey") color = null + + if(node1 && node2) icon_state = "intact[invisibility ? "-f" : "" ]" //var/node1_direction = get_dir(src, node1) @@ -237,8 +238,14 @@ obj/machinery/atmospherics/pipe/simple/update_icon() //dir = node1_direction|node2_direction else - if(!node1&&!node2) - del(src) //TODO: silent deleting looks weird + if(!node1 && !node2) + var/turf/T = get_turf(src) + new /obj/item/pipe(loc, make_from=src) + for (var/obj/machinery/meter/meter in T) + if (meter.target == src) + new /obj/item/pipe_meter(T) + del(meter) + del(src) var/have_node1 = node1?1:0 var/have_node2 = node2?1:0 icon_state = "exposed[have_node1][have_node2][invisibility ? "-f" : "" ]" @@ -265,6 +272,9 @@ obj/machinery/atmospherics/pipe/simple/initialize() node2 = target break + if(!node1 && !node2) + del(src) + return var/turf/T = src.loc // hide if turf is not intact hide(T.intact) @@ -1107,4 +1117,4 @@ obj/machinery/atmospherics/pipe/vent/hide(var/i) //to make the little pipe secti icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]intact" dir = get_dir(src, node1) else - icon_state = "exposed" + icon_state = "exposed" diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index c7829494aae..6c38715796d 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -428,7 +428,7 @@ Buildable meters //P.level = T.intact ? 2 : 1 P.initialize() if (!P) - usr << "There's nothing to connect this junction to! (with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)" + usr << "There's nothing to connect this pipe to!" //(with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)" return 1 P.build_network() if (P.node1)