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
@@ -67,7 +67,7 @@
stored_energy = 0
return last_stored_energy_transferred
/obj/machinery/atmospherics/binary/circulator/process()
/obj/machinery/atmospherics/binary/circulator/machinery_process()
..()
if(last_worldtime_transfer < world.time - 50)
@@ -144,4 +144,4 @@
return
src.set_dir(turn(src.dir, -90))
desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]."
desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]."
@@ -99,7 +99,7 @@
update_icon()
update_underlays()
/obj/machinery/atmospherics/binary/dp_vent_pump/process()
/obj/machinery/atmospherics/binary/dp_vent_pump/machinery_process()
..()
last_power_draw = 0
@@ -44,7 +44,7 @@
/obj/machinery/atmospherics/binary/passive_gate/hide(var/i)
update_underlays()
/obj/machinery/atmospherics/binary/passive_gate/process()
/obj/machinery/atmospherics/binary/passive_gate/machinery_process()
..()
last_flow_rate = 0
@@ -62,7 +62,7 @@ Thus, the two variables affect pump operation are set in New():
/obj/machinery/atmospherics/binary/pump/hide(var/i)
update_underlays()
/obj/machinery/atmospherics/binary/pump/process()
/obj/machinery/atmospherics/binary/pump/machinery_process()
last_power_draw = 0
last_flow_rate = 0
@@ -57,7 +57,7 @@
return 0
/obj/machinery/atmospherics/omni/filter/process()
/obj/machinery/atmospherics/omni/filter/machinery_process()
if(!..())
return 0
@@ -97,7 +97,7 @@
return 0
/obj/machinery/atmospherics/omni/mixer/process()
/obj/machinery/atmospherics/omni/mixer/machinery_process()
if(!..())
return 0
@@ -61,7 +61,7 @@
/obj/machinery/atmospherics/omni/proc/error_check()
return
/obj/machinery/atmospherics/omni/process()
/obj/machinery/atmospherics/omni/machinery_process()
last_power_draw = 0
last_flow_rate = 0
@@ -37,7 +37,7 @@
/obj/machinery/atmospherics/portables_connector/hide(var/i)
update_underlays()
/obj/machinery/atmospherics/portables_connector/process()
/obj/machinery/atmospherics/portables_connector/machinery_process()
..()
if(!on)
return
@@ -93,7 +93,7 @@
if(old_stat != stat)
update_icon()
/obj/machinery/atmospherics/trinary/filter/process()
/obj/machinery/atmospherics/trinary/filter/machinery_process()
..()
last_power_draw = 0
@@ -72,7 +72,7 @@
if (!mixing_inputs)
mixing_inputs = list(src.air1 = node1_concentration, src.air2 = node2_concentration)
/obj/machinery/atmospherics/trinary/mixer/process()
/obj/machinery/atmospherics/trinary/mixer/machinery_process()
..()
last_power_draw = 0
+1 -1
View File
@@ -179,7 +179,7 @@
else
src.go_to_side()
/obj/machinery/atmospherics/tvalve/process()
/obj/machinery/atmospherics/tvalve/machinery_process()
..()
. = PROCESS_KILL
//machines.Remove(src)
@@ -117,7 +117,7 @@
add_fingerprint(usr)
/obj/machinery/atmospherics/unary/freezer/process()
/obj/machinery/atmospherics/unary/freezer/machinery_process()
..()
if(stat & (NOPOWER|BROKEN) || !use_power)
@@ -66,7 +66,7 @@
return
/obj/machinery/atmospherics/unary/heater/process()
/obj/machinery/atmospherics/unary/heater/machinery_process()
..()
if(stat & (NOPOWER|BROKEN) || !use_power)
@@ -48,7 +48,7 @@
if(old_stat != stat)
update_icon()
/obj/machinery/atmospherics/unary/outlet_injector/process()
/obj/machinery/atmospherics/unary/outlet_injector/machinery_process()
..()
last_power_draw = 0
@@ -167,7 +167,7 @@
return 0
return 1
/obj/machinery/atmospherics/unary/vent_pump/process()
/obj/machinery/atmospherics/unary/vent_pump/machinery_process()
..()
if (hibernate > world.time)
@@ -131,7 +131,7 @@
return 1
/obj/machinery/atmospherics/unary/vent_scrubber/process()
/obj/machinery/atmospherics/unary/vent_scrubber/machinery_process()
..()
if (hibernate > world.time)
+2 -4
View File
@@ -136,11 +136,9 @@
else
src.open()
/obj/machinery/atmospherics/valve/process()
/obj/machinery/atmospherics/valve/machinery_process()
..()
. = PROCESS_KILL
return
return PROCESS_KILL
/obj/machinery/atmospherics/valve/initialize()
normalize_dir()