Merge pull request #1137 from Citadel-Station-13/upstream-merge-27541
[MIRROR] If you're gonna make a subsystem do it right
This commit is contained in:
@@ -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
|
||||
@@ -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 ..()
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
+1
-1
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user