[MIRROR] Organ removal ends metabolizing reagents in the organ (#768)

* Organ removal ends metabolizing reagents in the organ (#53619)

If an organ contains reagents it will end metabolizing them on removal.

* Organ removal ends metabolizing reagents in the organ

Co-authored-by: NightRed <nightred@gmail.com>
This commit is contained in:
SkyratBot
2020-09-12 03:10:03 +02:00
committed by GitHub
co-authored by NightRed
parent b96be3a2e3
commit 9dcf9c59fc
2 changed files with 23 additions and 1 deletions
@@ -60,6 +60,16 @@
//Special is for instant replacement like autosurgeons
/obj/item/organ/proc/Remove(mob/living/carbon/M, special = FALSE)
//Stop any reagent metabolizing on organ destruction
if(reagents && iscarbon(owner))
var/mob/living/carbon/body = owner
for(var/chem in reagents.reagent_list)
var/datum/reagent/reagent = chem
if(reagent.metabolizing)
reagent.metabolizing = FALSE
reagent.on_mob_end_metabolize(body)
reagent.on_mob_delete(body) //It was removed from the body
owner = null
if(M)
M.internal_organs -= src