Files
Paradise/code/controllers/Processes/machinery.dm
2015-06-27 01:56:57 -04:00

36 lines
785 B
Plaintext

/datum/controller/process/machinery/setup()
name = "machinery"
schedule_interval = 20 // every 2 seconds
/datum/controller/process/machinery/doWork()
//#ifdef PROFILE_MACHINES
//machine_profiling.len = 0
//#endif
for(var/obj/machinery/M in machines)
if(M && isnull(M.gcDestroyed))
#ifdef PROFILE_MACHINES
var/time_start = world.timeofday
#endif
if(M.process() == PROCESS_KILL)
//M.inMachineList = 0 We don't use this debugging function
machines.Remove(M)
continue
if(M && M.use_power)
M.auto_use_power()
#ifdef PROFILE_MACHINES
var/time_end = world.timeofday
if(!(M.type in machine_profiling))
machine_profiling[M.type] = 0
machine_profiling[M.type] += (time_end - time_start)
#endif
else
machines -= M
scheck()