machinery_process() & auto_use_power efficiency tweaks (#2657)

changes:

Machinery now uses machinery_process() instead of process(), allowing machines to be put into SSprocessing-style lists in addition to the machinery list.
Automatic power calculations now involve less proc-calls.
This commit is contained in:
Lohikar
2017-06-12 19:09:36 +03:00
committed by skull132
parent 585a6c59dd
commit 0db557ac29
138 changed files with 204 additions and 179 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ var/global/list/rad_collectors = list()
rad_collectors -= src
return ..()
/obj/machinery/power/rad_collector/process()
/obj/machinery/power/rad_collector/machinery_process()
//so that we don't zero out the meter if the SM is processed first.
last_power = last_power_new
last_power_new = 0
+1 -1
View File
@@ -107,7 +107,7 @@
src.use_power = 1 */
return 1
/obj/machinery/power/emitter/process()
/obj/machinery/power/emitter/machinery_process()
if(stat & (BROKEN))
return
if(src.state != 2 || (!powernet && active_power_usage))
@@ -58,7 +58,7 @@ field_generator power level display
connected_gens = list()
return
/obj/machinery/field_generator/process()
/obj/machinery/field_generator/machinery_process()
if(Varedit_start == 1)
if(active == 0)
active = 1
+1 -1
View File
@@ -10,7 +10,7 @@
var/energy = 0
var/creation_type = /obj/singularity
/obj/machinery/the_singularitygen/process()
/obj/machinery/the_singularitygen/machinery_process()
var/turf/T = get_turf(src)
if(src.energy >= 200)
new creation_type(T, 50)
@@ -149,7 +149,7 @@
return
/obj/machinery/particle_accelerator/control_box/process()
/obj/machinery/particle_accelerator/control_box/machinery_process()
if(src.active)
//a part is missing!
if( length(connected_parts) < 6 )