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
This commit is contained in:
oranges
2019-01-09 21:49:06 +00:00
parent d566771b20
commit 5b792193b8
@@ -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)