mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Tweak to Radiation Optimization
* Optimized garbage collection of radiation sources until we get qdel() hints. * Made the RADIATION_LOWER_LIMIT configurable (option for people to save some cpu time) * Added some comments and broke the proccessor into separate procs for profiling purposes * Added a changelog.
This commit is contained in:
@@ -7,7 +7,12 @@
|
||||
linked = radiation_repository
|
||||
|
||||
/datum/controller/process/radiation/doWork()
|
||||
// Step 1 - Sources Decay
|
||||
sources_decay()
|
||||
cache_expires()
|
||||
irradiate_targets()
|
||||
|
||||
// Step 1 - Sources Decay
|
||||
/datum/controller/process/radiation/proc/sources_decay()
|
||||
var/list/sources = linked.sources
|
||||
for(var/thing in sources)
|
||||
if(deleted(thing))
|
||||
@@ -20,7 +25,8 @@
|
||||
sources.Remove(S)
|
||||
SCHECK // This scheck probably just wastes resources, but better safe than sorry in this case.
|
||||
|
||||
// Step 2 - Cache Expires
|
||||
// Step 2 - Cache Expires
|
||||
/datum/controller/process/radiation/proc/cache_expires()
|
||||
var/list/resistance_cache = linked.resistance_cache
|
||||
for(var/thing in resistance_cache)
|
||||
if(deleted(thing))
|
||||
@@ -32,6 +38,7 @@
|
||||
SCHECK
|
||||
|
||||
// Step 3 - Registered irradiatable things are checked for radiation
|
||||
/datum/controller/process/radiation/proc/irradiate_targets()
|
||||
var/list/registered_listeners = living_mob_list // For now just use this. Nothing else is interested anyway.
|
||||
if(length(linked.sources) > 0)
|
||||
for(var/thing in registered_listeners)
|
||||
|
||||
@@ -720,6 +720,9 @@ var/list/gamemode_cache = list()
|
||||
if(values.len > 0)
|
||||
language_prefixes = values
|
||||
|
||||
if("radiation_lower_limit")
|
||||
radiation_lower_limit = text2num(value)
|
||||
|
||||
else
|
||||
log_misc("Unknown setting in configuration: '[name]'")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user