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
+1
View File
@@ -104,6 +104,7 @@
if(prob(addiction_removal_chance))
to_chat(occupant, "<span class='notice'>You no longer feel reliant on [R.name]!</span>")
occupant.reagents.addiction_list.Remove(R)
qdel(R)
for(var/mob/M as mob in src) // makes sure that simple mobs don't get stuck inside a sleeper when they resist out of occupant's grasp
if(M == occupant)
@@ -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