Fixes bugs with shuttles breaking pipes, wires and disposals
This commit is contained in:
@@ -60,19 +60,24 @@ Pipelines + Other Objects -> Pipe network
|
||||
N.disconnect(src)
|
||||
NODE_I = null
|
||||
|
||||
/obj/machinery/atmospherics/proc/getNodeConnects()
|
||||
var/list/node_connects = list()
|
||||
node_connects.len = device_type
|
||||
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
for(var/D in GLOB.cardinal)
|
||||
if(D & GetInitDirections())
|
||||
if(D in node_connects)
|
||||
continue
|
||||
node_connects[I] = D
|
||||
break
|
||||
return node_connects
|
||||
|
||||
|
||||
//this is called just after the air controller sets up turfs
|
||||
/obj/machinery/atmospherics/proc/atmosinit(var/list/node_connects)
|
||||
if(!node_connects) //for pipes where order of nodes doesn't matter
|
||||
node_connects = list()
|
||||
node_connects.len = device_type
|
||||
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
for(var/D in GLOB.cardinal)
|
||||
if(D & GetInitDirections())
|
||||
if(D in node_connects)
|
||||
continue
|
||||
node_connects[I] = D
|
||||
break
|
||||
node_connects = getNodeConnects()
|
||||
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connects[I]))
|
||||
@@ -288,3 +293,47 @@ Pipelines + Other Objects -> Pipe network
|
||||
//Used for certain children of obj/machinery/atmospherics to not show pipe vision when mob is inside it.
|
||||
/obj/machinery/atmospherics/proc/can_see_pipes()
|
||||
return 1
|
||||
|
||||
//Properly updates pipes on shuttle movement
|
||||
/obj/machinery/atmospherics/shuttleRotate(rotation)
|
||||
var/list/real_node_connect = getNodeConnects()
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
real_node_connect[I] = angle2dir(rotation+dir2angle(real_node_connect[I]))
|
||||
|
||||
..()
|
||||
SetInitDirections()
|
||||
var/list/supposed_node_connect = getNodeConnects()
|
||||
var/list/nodes_copy = nodes.Copy()
|
||||
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
var/new_pos = supposed_node_connect.Find(real_node_connect[I])
|
||||
nodes[new_pos] = nodes_copy[I]
|
||||
|
||||
/obj/machinery/atmospherics/afterShuttleMove()
|
||||
..()
|
||||
var/missing_nodes = FALSE
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
if(src.nodes[I])
|
||||
var/obj/machinery/atmospherics/node = src.nodes[I]
|
||||
var/connected = FALSE
|
||||
for(var/D in GLOB.cardinal)
|
||||
if(node in get_step(src, D))
|
||||
connected = TRUE
|
||||
break
|
||||
|
||||
if(!connected)
|
||||
nullifyNode(I)
|
||||
|
||||
if(!src.nodes[I])
|
||||
missing_nodes = TRUE
|
||||
|
||||
if(missing_nodes)
|
||||
atmosinit()
|
||||
for(var/obj/machinery/atmospherics/A in pipeline_expansion())
|
||||
A.atmosinit()
|
||||
if(A.returnPipenet())
|
||||
A.addMember(src)
|
||||
build_network()
|
||||
else
|
||||
// atmosinit() calls update_icon(), so we don't need to call it
|
||||
update_icon()
|
||||
|
||||
@@ -26,9 +26,5 @@ Iconnery
|
||||
Housekeeping and pipe network stuff
|
||||
*/
|
||||
|
||||
/obj/machinery/atmospherics/components/binary/atmosinit()
|
||||
var/node2_connect = dir
|
||||
var/node1_connect = turn(dir, 180)
|
||||
|
||||
var/list/node_connects = list(node1_connect, node2_connect)
|
||||
..(node_connects)
|
||||
/obj/machinery/atmospherics/components/binary/getNodeConnects()
|
||||
return list(turn(dir, 180), dir)
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
Housekeeping and pipe network stuff
|
||||
*/
|
||||
|
||||
/obj/machinery/atmospherics/components/trinary/atmosinit()
|
||||
/obj/machinery/atmospherics/components/trinary/getNodeConnects()
|
||||
|
||||
//Mixer:
|
||||
//1 and 2 is input
|
||||
@@ -43,5 +43,4 @@ Housekeeping and pipe network stuff
|
||||
node1_connect = turn(node1_connect, 180)
|
||||
node3_connect = turn(node3_connect, 180)
|
||||
|
||||
var/list/node_connects = list(node1_connect, node2_connect, node3_connect)
|
||||
..(node_connects)
|
||||
return list(node1_connect, node2_connect, node3_connect)
|
||||
@@ -29,12 +29,8 @@
|
||||
initialize_directions = EAST
|
||||
initialize_directions_he = WEST
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/junction/atmosinit()
|
||||
var/node2_connect = dir
|
||||
var/node1_connect = turn(dir, 180)
|
||||
var/list/node_connects = list(node1_connect, node2_connect)
|
||||
|
||||
..(node_connects)
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/junction/getNodeConnects()
|
||||
return list(turn(dir, 180), dir)
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/junction/can_be_node(obj/machinery/atmospherics/target, iteration)
|
||||
var/init_dir
|
||||
|
||||
Reference in New Issue
Block a user