Merge pull request #1521 from Fox-McCloud/powernet-into-machines

Merging Powernets into Machines
This commit is contained in:
TheDZD
2015-07-15 19:44:03 -04:00
5 changed files with 12 additions and 59 deletions
+12 -3
View File
@@ -3,10 +3,10 @@
schedule_interval = 20 // every 2 seconds
/datum/controller/process/machinery/doWork()
//#ifdef PROFILE_MACHINES
//machine_profiling.len = 0
//#endif
process_power()
process_machines()
/datum/controller/process/machinery/proc/process_machines()
for(var/obj/machinery/M in machines)
if(M && isnull(M.gcDestroyed))
#ifdef PROFILE_MACHINES
@@ -33,3 +33,12 @@
machines -= M
scheck()
/datum/controller/process/machinery/proc/process_power()
for(var/datum/powernet/powerNetwork in powernets)
if(istype(powerNetwork) && isnull(powerNetwork.gcDestroyed))
powerNetwork.reset()
scheck()
continue
else
powernets -= powerNetwork
@@ -1,40 +0,0 @@
var/global/list/power_machinery_profiling = list()
/datum/controller/process/power_machinery
var/tmp/datum/updateQueue/updateQueueInstance
/datum/controller/process/power_machinery/setup()
name = "pow_machine"
schedule_interval = 20 // every 2 seconds
/datum/controller/process/power_machinery/doWork()
for(var/obj/machinery/M in power_machines)
if(istype(M) && isnull(M.gcDestroyed))
#ifdef PROFILE_MACHINES
var/time_start = world.timeofday
#endif
if(M.process() == PROCESS_KILL)
M.inMachineList = 0
power_machines -= M
continue
if(M && M.use_power)
M.auto_use_power()
if(istype(M))
#ifdef PROFILE_MACHINES
var/time_end = world.timeofday
if(!(M.type in power_machinery_profiling))
power_machinery_profiling[M.type] = 0
power_machinery_profiling[M.type] += (time_end - time_start)
#endif
else
power_machines -= M
else
if(istype(M))
M.inMachineList = 0
power_machines -= M
scheck()
-12
View File
@@ -1,12 +0,0 @@
/datum/controller/process/powernet/setup()
name = "powernet"
schedule_interval = 20 // every 2 seconds
/datum/controller/process/powernet/doWork()
for(var/datum/powernet/powerNetwork in powernets)
if(istype(powerNetwork) && isnull(powerNetwork.gcDestroyed))
powerNetwork.reset()
scheck()
continue
else
powernets -= powerNetwork
-3
View File
@@ -966,9 +966,6 @@ var/list/slot_equipment_priority = list( \
process = processScheduler.getProcess("pipenet")
stat(null, "PIP([pipe_networks.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
process = processScheduler.getProcess("powernet")
stat(null, "POW([powernets.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
process = processScheduler.getProcess("nanoui")
stat(null, "NAN([nanomanager.processing_uis.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]")