diff --git a/code/ATMOSPHERICS/pipes/manifold.dm b/code/ATMOSPHERICS/pipes/manifold.dm index f44bfc5686..4845aeae08 100644 --- a/code/ATMOSPHERICS/pipes/manifold.dm +++ b/code/ATMOSPHERICS/pipes/manifold.dm @@ -108,16 +108,23 @@ underlays.Cut() var/turf/T = get_turf(src) - var/list/directions = list(NORTH, SOUTH, EAST, WEST) - var/node1_direction = get_dir(src, node1) - var/node2_direction = get_dir(src, node2) - var/node3_direction = get_dir(src, node3) + // Unfortunately our nodes are not in consistent directions (see atmos_init()) so do the dance... + var/list/directions = list(NORTH, SOUTH, EAST, WEST) // UN-connected directions directions -= dir + if(node1) + var/node1_direction = get_dir(src, node1) + add_underlay(T, node1, node1_direction, icon_connect_type) + directions -= node1_direction + if(node2) + var/node2_direction = get_dir(src, node2) + add_underlay(T, node2, node2_direction, icon_connect_type) + directions -= node2_direction + if(node3) + var/node3_direction = get_dir(src, node3) + add_underlay(T, node3, node3_direction, icon_connect_type) + directions -= node3_direction - directions -= add_underlay(T,node1,node1_direction,icon_connect_type) - directions -= add_underlay(T,node2,node2_direction,icon_connect_type) - directions -= add_underlay(T,node3,node3_direction,icon_connect_type) for(var/D in directions) add_underlay(T,,D,icon_connect_type) diff --git a/code/ATMOSPHERICS/pipes/manifold4w.dm b/code/ATMOSPHERICS/pipes/manifold4w.dm index 197c1a090b..55e09fd8a3 100644 --- a/code/ATMOSPHERICS/pipes/manifold4w.dm +++ b/code/ATMOSPHERICS/pipes/manifold4w.dm @@ -107,36 +107,12 @@ overlays += icon_manager.get_atmos_icon("manifold", , , "clamps_4way" + icon_connect_type) underlays.Cut() - /* - var/list/directions = list(NORTH, SOUTH, EAST, WEST) - - - directions -= add_underlay(node1) - directions -= add_underlay(node2) - directions -= add_underlay(node3) - directions -= add_underlay(node4) - - for(var/D in directions) - add_underlay(,D) - */ - var/turf/T = get_turf(src) - var/list/directions = list(NORTH, SOUTH, EAST, WEST) - var/node1_direction = get_dir(src, node1) - var/node2_direction = get_dir(src, node2) - var/node3_direction = get_dir(src, node3) - var/node4_direction = get_dir(src, node4) - - directions -= dir - - directions -= add_underlay(T,node1,node1_direction,icon_connect_type) - directions -= add_underlay(T,node2,node2_direction,icon_connect_type) - directions -= add_underlay(T,node3,node3_direction,icon_connect_type) - directions -= add_underlay(T,node4,node4_direction,icon_connect_type) - - for(var/D in directions) - add_underlay(T,,D,icon_connect_type) - + // Take advantage of the fact that our nodes are *always* in the same directions (see atmos_init()) + add_underlay(T, node1, NORTH, icon_connect_type) + add_underlay(T, node2, SOUTH, icon_connect_type) + add_underlay(T, node3, EAST, icon_connect_type) + add_underlay(T, node4, WEST, icon_connect_type) /obj/machinery/atmospherics/pipe/manifold4w/update_underlays() ..()