Effeciency Project: APC / Machinery power usage.

We no longer run auto_use_power() on every machine every tick.
We now have a global list of areas, and areas that have an APC in them (all_areas and active_areas) no more looping through world bullshit.
A bunch of snowflakey as fuck machines won't use_power() in their process, you get two options, active and idle, use them!
This means a lot of machines won't double dip on power as well so power usage for the station has dropped about 20%

Because everything is snowflakey as fuck we're going to have some machines that don't force an update on their power usage.  Fuck them.
We should catch them with the root obj/machine/proc's forcing updates.

Conflicts:
	code/modules/mob/mob.dm
	code/modules/power/apc.dm
This commit is contained in:
Ccomp5950
2014-03-08 03:42:44 -06:00
committed by ZomgPonies
parent b97434054f
commit e7d4f4ad4b
13 changed files with 77 additions and 62 deletions
+4 -3
View File
@@ -278,15 +278,16 @@ datum/controller/game_controller/proc/process_machines()
while(i<=active_areas.len)
var/area/A = active_areas[i]
if(A.powerupdate)
if(A.debug)
world << "process_machines [A] powerupdate is [A.powerupdate]"
A.powerupdate -= 1
for(var/obj/machinery/M in A)
if(M)
if(M.use_power)
M.auto_use_power()
i++
if(A.apc.len)
i++
continue
active_areas.Cut(i,i+1)
datum/controller/game_controller/proc/process_objects()