Powernet Refactor

This commit is contained in:
Fox McCloud
2019-04-27 02:06:04 -04:00
parent 0fb164d041
commit d0a077f9d5
18 changed files with 415 additions and 428 deletions
-24
View File
@@ -64,23 +64,6 @@ SUBSYSTEM_DEF(machines)
if(MC_TICK_CHECK)
return
/datum/controller/subsystem/machines/proc/process_premachines(resumed = 0)
/* Literally exists as snowflake for fucking powersinks goddamnit */
if(!resumed)
src.currentrun = GLOB.processing_power_items.Copy()
//cache for sanid speed (lists are references anyways)
var/list/currentrun = src.currentrun
while(currentrun.len)
var/obj/item/I = currentrun[currentrun.len]
currentrun.len--
if(!QDELETED(I))
if(!I.pwr_drain())
GLOB.processing_power_items.Remove(I)
else
GLOB.processing_power_items.Remove(I)
if(MC_TICK_CHECK)
return
/datum/controller/subsystem/machines/proc/process_machines(resumed = 0)
var/seconds = wait * 0.1
if(!resumed)
@@ -113,13 +96,6 @@ SUBSYSTEM_DEF(machines)
if(state != SS_RUNNING)
return
resumed = 0
currentpart = SSMACHINES_PREMACHINERY
if(currentpart == SSMACHINES_PREMACHINERY || !resumed)
process_premachines(resumed)
if(state != SS_RUNNING)
return
resumed = 0
currentpart = SSMACHINES_MACHINERY
if(currentpart == SSMACHINES_MACHINERY || !resumed)