From 3ef56206c1c279c0812f12dbc84dace8669afd27 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Thu, 24 Aug 2017 20:31:54 -0500 Subject: [PATCH] Fixes component cleanup (#2485) --- code/datums/datum.dm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/code/datums/datum.dm b/code/datums/datum.dm index 3bedbe87cf..cd589fd8c3 100644 --- a/code/datums/datum.dm +++ b/code/datums/datum.dm @@ -22,10 +22,16 @@ continue qdel(timer) var/list/dc = datum_components - for(var/I in dc) - var/datum/component/C = I - C._RemoveNoSignal() - qdel(C) if(dc) + var/all_components = dc[/datum/component] + if(islist(all_components)) + for(var/I in all_components) + var/datum/component/C = I + C._RemoveNoSignal() + qdel(C) + else + var/datum/component/C = all_components + C._RemoveNoSignal() + qdel(C) dc.Cut() - return QDEL_HINT_QUEUE \ No newline at end of file + return QDEL_HINT_QUEUE