From 5b792193b84aaf59aba551ec2cd24fa1fc49b2cd Mon Sep 17 00:00:00 2001 From: oranges Date: Tue, 1 Jan 2019 11:15:52 +0000 Subject: [PATCH] Code no longer runtimes on species change for mobs on species change was removing the inert mutation (from the mutation index and mutation list) before trying to find it in that same list and checking the index. Instead we get the index first and then remove it --- code/modules/mob/living/carbon/human/species.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 12603960136..42b0f040280 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -301,10 +301,12 @@ GLOBAL_LIST_EMPTY(roundstart_races) C.Digitigrade_Leg_Swap(TRUE) for(var/X in inherent_traits) C.remove_trait(X, SPECIES_TRAIT) + + //If their inert mutation is not the same, swap it out if((inert_mutation != new_species.inert_mutation) && LAZYLEN(C.dna.mutation_index)) C.dna.remove_mutation(inert_mutation) - C.dna.mutation_index[C.dna.mutation_index.Find(inert_mutation)] = new_species.inert_mutation - C.dna.mutation_index[new_species.inert_mutation] = create_sequence(new_species.inert_mutation) + C.dna.add_mutation(new_species.inert_mutation) + C.remove_movespeed_modifier(MOVESPEED_ID_SPECIES) SEND_SIGNAL(C, COMSIG_SPECIES_LOSS, src)