Fix manifold and manifold4w underlay rendering.

Don't add twice as many underlays as you need, thanks!
This commit is contained in:
Leshana
2020-04-06 16:09:20 -04:00
parent c81f9de1ac
commit 22844cfb5c
2 changed files with 19 additions and 36 deletions
+14 -7
View File
@@ -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)
+5 -29
View File
@@ -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()
..()