Defers pipenet and powernet rebuilds upon destruction of pipes and cables so explosions are faster

This commit is contained in:
Tastyfish
2016-04-29 23:42:47 -04:00
parent b8d9108c9c
commit 3b59d2cd15
35 changed files with 199 additions and 163 deletions
+2 -4
View File
@@ -437,10 +437,8 @@ obj/structure/cable/proc/cableColor(var/colorC)
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
// queue it to rebuild
deferred_powernet_rebuilds += O
// Disconnect machines connected to nodes
if(d1 == 0) // if we cut a node (O-X) cable