mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-13 17:14:47 +01:00
Adds lag check to diseases and events (and removes lighting from dwait)
lighting removed from dewait because lag checks are better for it and lag checked subsystems that are also dwait systems are given lower priority, we don't want that to happen to lighting.
This commit is contained in:
@@ -3,7 +3,7 @@ var/datum/subsystem/diseases/SSdisease
|
||||
/datum/subsystem/diseases
|
||||
name = "Diseases"
|
||||
priority = 7
|
||||
|
||||
var/list/currentrun = list()
|
||||
var/list/processing = list()
|
||||
|
||||
/datum/subsystem/diseases/New()
|
||||
@@ -12,9 +12,18 @@ var/datum/subsystem/diseases/SSdisease
|
||||
/datum/subsystem/diseases/stat_entry(msg)
|
||||
..("P:[processing.len]")
|
||||
|
||||
/datum/subsystem/diseases/fire()
|
||||
for(var/thing in processing)
|
||||
/datum/subsystem/diseases/fire(resumed = 0)
|
||||
if(!resumed)
|
||||
src.currentrun = processing.Copy()
|
||||
//cache for sanic speed (lists are references anyways)
|
||||
var/list/currentrun = src.currentrun
|
||||
|
||||
while(currentrun.len)
|
||||
var/datum/thing = currentrun[1]
|
||||
currentrun.Cut(1, 2)
|
||||
if(thing)
|
||||
thing:process()
|
||||
continue
|
||||
processing.Remove(thing)
|
||||
thing.process()
|
||||
else
|
||||
processing.Remove(thing)
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
@@ -6,6 +6,7 @@ var/datum/subsystem/events/SSevent
|
||||
|
||||
var/list/control = list() //list of all datum/round_event_control. Used for selecting events based on weight and occurrences.
|
||||
var/list/running = list() //list of all existing /datum/round_event
|
||||
var/list/currentrun = list()
|
||||
|
||||
var/scheduled = 0 //The next world.time that a naturally occuring random event can be selected.
|
||||
var/frequency_lower = 1800 //3 minutes lower bound.
|
||||
@@ -34,14 +35,23 @@ var/datum/subsystem/events/SSevent
|
||||
..()
|
||||
|
||||
|
||||
/datum/subsystem/events/fire()
|
||||
checkEvent()
|
||||
for(var/thing in running)
|
||||
if(thing)
|
||||
thing:process()
|
||||
continue
|
||||
running.Remove(thing)
|
||||
/datum/subsystem/events/fire(resumed = 0)
|
||||
if(!resumed)
|
||||
checkEvent() //only check these if we aren't resuming a paused fire
|
||||
src.currentrun = running.Copy()
|
||||
|
||||
//cache for sanic speed (lists are references anyways)
|
||||
var/list/currentrun = src.currentrun
|
||||
|
||||
while(currentrun.len)
|
||||
var/datum/thing = currentrun[1]
|
||||
currentrun.Cut(1, 2)
|
||||
if(thing)
|
||||
thing.process()
|
||||
else
|
||||
running.Remove(thing)
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
//checks if we should select a random event yet, and reschedules if necessary
|
||||
/datum/subsystem/events/proc/checkEvent()
|
||||
|
||||
@@ -5,9 +5,7 @@ var/datum/subsystem/lighting/SSlighting
|
||||
/datum/subsystem/lighting
|
||||
name = "Lighting"
|
||||
priority = 1
|
||||
wait = 5
|
||||
dynamic_wait = 1
|
||||
dwait_delta = 3
|
||||
wait = 6
|
||||
display = 5
|
||||
|
||||
var/list/changed_lights = list() //list of all datum/light_source that need updating
|
||||
|
||||
Reference in New Issue
Block a user