From d4ebcac3f6964b1311e835d5378950c4da950919 Mon Sep 17 00:00:00 2001 From: Leshana Date: Mon, 5 Jun 2017 18:02:16 -0400 Subject: [PATCH] Update radiation system for the new garbage collector. --- code/controllers/Processes/radiation.dm | 18 +++++++++--------- code/datums/repositories/radiation.dm | 8 -------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/code/controllers/Processes/radiation.dm b/code/controllers/Processes/radiation.dm index 192acf5d5cb..71d9c60233e 100644 --- a/code/controllers/Processes/radiation.dm +++ b/code/controllers/Processes/radiation.dm @@ -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) diff --git a/code/datums/repositories/radiation.dm b/code/datums/repositories/radiation.dm index 0245bb801cf..00c35324580 100644 --- a/code/datums/repositories/radiation.dm +++ b/code/datums/repositories/radiation.dm @@ -22,14 +22,6 @@ var/global/repository/radiation/radiation_repository = new() src.source_turf = null . = ..() -// TEMPORARY HACK - hard del()'ing sources is too expensive! Until we implement qdel() hints we need to override behavior here -/datum/radiation_source/finalize_qdel() - if(garbage_collector) - garbage_collector.AddTrash(src) - else - delayed_garbage |= src -// TEMPORARY HACK END - /datum/radiation_source/proc/update_rad_power(var/new_power = null) if(new_power != null && new_power != rad_power) rad_power = new_power