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
+7 -1
View File
@@ -423,7 +423,8 @@
return process(targloc)
/obj/item/projectile/test/process(var/turf/targloc)
while(src) //Loop on through!
var/safety = 100 // We really never should need this to last longer than this number of iterations.
while(!QDELING(src) && safety > 0) //Loop on through!
if(result)
return (result - 1)
if((!( targloc ) || loc == targloc))
@@ -442,6 +443,11 @@
if(istype(M))
return 1
safety--
if (safety < 0)
crash_with("test projectile process() maximum iterations exceeded, aborting!")
//Helper proc to check if you can hit them or not.
/proc/check_trajectory(atom/target as mob|obj, atom/firer as mob|obj, var/pass_flags=PASSTABLE|PASSGLASS|PASSGRILLE, flags=null)
if(!istype(target) || !istype(firer))