Removes a bunch of sleeps/spawns and makes a few booleans defines

This commit is contained in:
kevinz000
2017-10-14 16:53:17 -07:00
committed by CitadelStationBot
parent b200389630
commit b20e5916ea
24 changed files with 272 additions and 236 deletions
+6 -4
View File
@@ -399,6 +399,11 @@ By design, d1 is the smallest direction and d2 is the highest
if(PN.is_empty()) //can happen with machines made nodeless when smoothing cables
qdel(PN)
/obj/structure/cable/proc/auto_propogate_cut_cable(obj/O)
if(O && !QDELETED(O))
var/datum/powernet/newPN = new()// creates a new powernet...
propagate_network(O, newPN)//... and propagates it to the other side of the cable
// cut the cable's powernet at this cable and updates the powergrid
/obj/structure/cable/proc/cut_cable_from_powernet(remove=TRUE)
var/turf/T1 = loc
@@ -426,10 +431,7 @@ By design, d1 is the smallest direction and d2 is the highest
loc = null
powernet.remove_cable(src) //remove the cut cable from its powernet
spawn(0) //so we don't rebuild the network X times when singulo/explosion destroys a line of X cables
if(O && !QDELETED(O))
var/datum/powernet/newPN = new()// creates a new powernet...
propagate_network(O, newPN)//... and propagates it to the other side of the cable
addtimer(CALLBACK(src, .proc/auto_propogate_cut_cable, O), 0) //so we don't rebuild the network X times when singulo/explosion destroys a line of X cables
// Disconnect machines connected to nodes
if(d1 == 0) // if we cut a node (O-X) cable