diff --git a/code/controllers/subsystem/fields.dm b/code/controllers/subsystem/fields.dm deleted file mode 100644 index 8e9f387478..0000000000 --- a/code/controllers/subsystem/fields.dm +++ /dev/null @@ -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 diff --git a/code/controllers/subsystem/processing/fields.dm b/code/controllers/subsystem/processing/fields.dm new file mode 100644 index 0000000000..6a878fa142 --- /dev/null +++ b/code/controllers/subsystem/processing/fields.dm @@ -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 diff --git a/code/modules/fields/fields.dm b/code/modules/fields/fields.dm index 4e18e45e9a..0e15d24e03 100644 --- a/code/modules/fields/fields.dm +++ b/code/modules/fields/fields.dm @@ -28,7 +28,6 @@ var/square_depth_up = 0 var/square_depth_down = 0 //Processing - var/requires_processing = FALSE var/process_inner_turfs = FALSE //Don't do this unless it's absolutely necessary var/process_edge_turfs = FALSE //Don't do this either unless it's absolutely necessary, you can just track what things are inside manually or on the initial setup. var/setup_edge_turfs = FALSE //Setup edge turfs/all field turfs. Set either or both to ON when you need it, it's defaulting to off unless you do to save CPU. @@ -40,11 +39,7 @@ var/list/turf/field_turfs_new = list() var/list/turf/edge_turfs_new = list() -/datum/proximity_monitor/advanced/New() - SSfields.register_new_field(src) - /datum/proximity_monitor/advanced/Destroy() - SSfields.unregister_field(src) full_cleanup() return ..() diff --git a/code/modules/fields/peaceborg_dampener.dm b/code/modules/fields/peaceborg_dampener.dm index 9cfc34f127..5d2d2829a9 100644 --- a/code/modules/fields/peaceborg_dampener.dm +++ b/code/modules/fields/peaceborg_dampener.dm @@ -3,7 +3,6 @@ //Only use square radius for this! /datum/proximity_monitor/advanced/peaceborg_dampener name = "\improper Hyperkinetic Dampener Field" - requires_processing = TRUE setup_edge_turfs = TRUE setup_field_turfs = TRUE field_shape = FIELD_SHAPE_RADIUS_SQUARE @@ -22,10 +21,15 @@ use_host_turf = TRUE /datum/proximity_monitor/advanced/peaceborg_dampener/New() + START_PROCESSING(SSfields, src) tracked = list() staging = list() ..() +/datum/proximity_monitor/advanced/peaceborg_dampener/Destroy() + STOP_PROCESSING(SSfields, src) + return ..() + /datum/proximity_monitor/advanced/peaceborg_dampener/process() if(!istype(projector)) qdel(src) diff --git a/tgstation.dme b/tgstation.dme index 154540e10d..2d2e35f59e 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -196,7 +196,6 @@ #include "code\controllers\subsystem\dbcore.dm" #include "code\controllers\subsystem\disease.dm" #include "code\controllers\subsystem\events.dm" -#include "code\controllers\subsystem\fields.dm" #include "code\controllers\subsystem\fire_burning.dm" #include "code\controllers\subsystem\garbage.dm" #include "code\controllers\subsystem\icon_smooth.dm" @@ -231,6 +230,7 @@ #include "code\controllers\subsystem\vote.dm" #include "code\controllers\subsystem\weather.dm" #include "code\controllers\subsystem\processing\fastprocess.dm" +#include "code\controllers\subsystem\processing\fields.dm" #include "code\controllers\subsystem\processing\flightpacks.dm" #include "code\controllers\subsystem\processing\obj.dm" #include "code\controllers\subsystem\processing\overlays.dm"