Merge pull request #35782 from Cruix/mutate_off

Fixed mutate not removing its effects when refunded
This commit is contained in:
oranges
2018-02-20 10:04:54 +13:00
committed by CitadelStationBot
parent fef23bd7cc
commit 07fc2d1f5e

View File

@@ -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)