If you're gonna make a subsystem do it right

This commit is contained in:
CitadelStationBot
2017-05-23 13:45:27 -05:00
parent 21b9e3a160
commit 7abd50a97d
5 changed files with 12 additions and 34 deletions
-27
View File
@@ -1,27 +0,0 @@
SUBSYSTEM_DEF(fields)
name = "Fields"
wait = 2
priority = 40
flags = SS_KEEP_TIMING
var/list/datum/proximity_monitor/advanced/running = list()
var/list/datum/proximity_monitor/advanced/currentrun = list()
/datum/controller/subsystem/fields/fire(resumed = 0)
if(!resumed)
src.currentrun = running.Copy()
var/list/currentrun = src.currentrun
while(currentrun.len)
var/datum/proximity_monitor/advanced/F = currentrun[currentrun.len]
currentrun.len--
if(!F.requires_processing)
continue
F.process()
if(MC_TICK_CHECK)
return
/datum/controller/subsystem/fields/proc/register_new_field(datum/proximity_monitor/advanced/F)
running += F
/datum/controller/subsystem/fields/proc/unregister_field(datum/proximity_monitor/advanced/F)
running -= F
@@ -0,0 +1,6 @@
PROCESSING_SUBSYSTEM_DEF(fields)
name = "Fields"
wait = 2
priority = 40
flags = SS_KEEP_TIMING | SS_NO_INIT
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME