mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-29 16:10:02 +01:00
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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user