Reagent Garbage Collection Edge Case

This commit is contained in:
Fox McCloud
2019-03-24 16:32:10 -04:00
parent c2a2c1c4ce
commit dd3d32d897
3 changed files with 6 additions and 0 deletions
@@ -292,6 +292,8 @@ var/const/INGEST = 2
if(prob(20) && (world.timeofday > (R.last_addiction_dose + ADDICTION_TIME))) //Each addiction lasts 8 minutes before it can end
to_chat(M, "<span class='notice'>You no longer feel reliant on [R.name]!</span>")
addiction_list.Remove(R)
qdel(R)
if(update_flags & STATUS_UPDATE_HEALTH)
M.updatehealth("reagent metabolism")
else if(update_flags & STATUS_UPDATE_STAT)
@@ -32,6 +32,9 @@
/datum/reagent/Destroy()
. = ..()
holder = null
if(islist(data))
data.Cut()
data = null
/datum/reagent/proc/reaction_temperature(exposed_temperature, exposed_volume) //By default we do nothing.
return