Update radiation system for the new garbage collector.

This commit is contained in:
Leshana
2017-06-05 18:02:16 -04:00
parent ebe5cc916d
commit d4ebcac3f6
2 changed files with 9 additions and 17 deletions

View File

@@ -15,10 +15,10 @@
/datum/controller/process/radiation/proc/sources_decay()
var/list/sources = linked.sources
for(var/thing in sources)
if(deleted(thing))
sources.Remove(thing)
continue
var/datum/radiation_source/S = thing
if(QDELETED(S))
sources.Remove(S)
continue
if(S.decay)
S.update_rad_power(S.rad_power - config.radiation_decay_rate)
if(S.rad_power <= config.radiation_lower_limit)
@@ -29,22 +29,22 @@
/datum/controller/process/radiation/proc/cache_expires()
var/list/resistance_cache = linked.resistance_cache
for(var/thing in resistance_cache)
if(deleted(thing))
resistance_cache.Remove(thing)
continue
var/turf/T = thing
if(QDELETED(T))
resistance_cache.Remove(T)
continue
if((length(T.contents) + 1) != resistance_cache[T])
resistance_cache.Remove(T) // If its stale REMOVE it! It will get added if its needed.
SCHECK
// Step 3 - Registered irradiatable things are checked for radiation
// 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)
if(deleted(thing))
continue
var/atom/A = thing
if(QDELETED(A))
continue
var/turf/T = get_turf(thing)
var/rads = linked.get_rads_at_turf(T)
if(rads)