Removes a bunch of sleeps/spawns and makes a few booleans defines
This commit is contained in:
committed by
CitadelStationBot
parent
b200389630
commit
b20e5916ea
@@ -260,17 +260,15 @@
|
||||
if(AMS.processing)
|
||||
AMS.shutdown_core()
|
||||
AMS.control_unit = null
|
||||
spawn(10)
|
||||
AMS.controllerscan()
|
||||
addtimer(CALLBACK(AMS, /obj/machinery/am_shielding.proc/controllerscan), 10)
|
||||
linked_shielding = list()
|
||||
|
||||
else
|
||||
for(var/obj/machinery/am_shielding/AMS in linked_shielding)
|
||||
AMS.update_icon()
|
||||
spawn(20)
|
||||
shield_icon_delay = 0
|
||||
return
|
||||
addtimer(CALLBACK(src, .proc/reset_shield_icon_delay), 20)
|
||||
|
||||
/obj/machinery/power/am_control_unit/proc/reset_shield_icon_delay()
|
||||
shield_icon_delay = 0
|
||||
|
||||
/obj/machinery/power/am_control_unit/proc/check_core_stability()
|
||||
if(stored_core_stability_delay || linked_cores.len <= 0)
|
||||
@@ -280,10 +278,10 @@
|
||||
for(var/obj/machinery/am_shielding/AMS in linked_cores)
|
||||
stored_core_stability += AMS.stability
|
||||
stored_core_stability/=linked_cores.len
|
||||
spawn(40)
|
||||
stored_core_stability_delay = 0
|
||||
return
|
||||
addtimer(CALLBACK(src, .proc/reset_stored_core_stability_delay), 40)
|
||||
|
||||
/obj/machinery/power/am_control_unit/proc/reset_stored_core_stability_delay()
|
||||
stored_core_stability_delay = 0
|
||||
|
||||
/obj/machinery/power/am_control_unit/interact(mob/user)
|
||||
if((get_dist(src, user) > 1) || (stat & (BROKEN|NOPOWER)))
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user