From 07fc2d1f5e5bc90f161efd08bb6b5189ad417f42 Mon Sep 17 00:00:00 2001 From: oranges Date: Tue, 20 Feb 2018 10:04:54 +1300 Subject: [PATCH] Merge pull request #35782 from Cruix/mutate_off Fixed mutate not removing its effects when refunded --- code/modules/spells/spell_types/genetic.dm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/modules/spells/spell_types/genetic.dm b/code/modules/spells/spell_types/genetic.dm index 43069e0033..e42aa182bc 100644 --- a/code/modules/spells/spell_types/genetic.dm +++ b/code/modules/spells/spell_types/genetic.dm @@ -2,6 +2,7 @@ name = "Genetic" desc = "This spell inflicts a set of mutations and disabilities upon the target." + var/list/active_on = list() var/list/traits = list() //disabilities var/list/mutations = list() //mutation strings var/duration = 100 //deciseconds @@ -24,9 +25,16 @@ target.dna.add_mutation(A) for(var/A in traits) target.add_trait(A, GENETICS_SPELL) + active_on += target addtimer(CALLBACK(src, .proc/remove, target), duration) +/obj/effect/proc_holder/spell/targeted/genetic/Destroy() + . = ..() + for(var/V in active_on) + remove(V) + /obj/effect/proc_holder/spell/targeted/genetic/proc/remove(mob/living/carbon/target) + active_on -= target if(!QDELETED(target)) for(var/A in mutations) target.dna.remove_mutation(A)