diff --git a/code/ATMOSPHERICS/pipes.dm b/code/ATMOSPHERICS/pipes.dm index c1fa2b0e9e..11daee64c3 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 c7829494aa..6c38715796 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)