From 21cfd5c4f5aea56c53ca6df66cddbcbf781d6b0f Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 14 Apr 2021 10:41:30 +0200 Subject: [PATCH] [MIRROR] Fixes mannitoil runtime (#4897) * Fixes mannitoil runtime (#58321) * Fixes runtimes in metabolism * Activate doesn't work as I expected * Removes bonus false * One last just in case check * Why did I even think while was a good idea * Fixes mannitoil runtime Co-authored-by: Thalpy <33956696+Thalpy@users.noreply.github.com> --- .../impure_medicine_reagents.dm | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/code/modules/reagents/chemistry/reagents/impure_reagents/impure_medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/impure_reagents/impure_medicine_reagents.dm index cc04b60483e..32a05cdfef8 100644 --- a/code/modules/reagents/chemistry/reagents/impure_reagents/impure_medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/impure_reagents/impure_medicine_reagents.dm @@ -591,17 +591,13 @@ Basically, we fill the time between now and 2s from now with hands based off the if(!carbon.dna) return var/list/speech_options = list(SWEDISH, UNINTELLIGIBLE, STONER, MEDIEVAL, WACKY, NERVOUS, MUT_MUTE) - while(speech_options || !speech_option) - var/potential_option = pick(speech_options) - if(carbon.dna.get_mutation(potential_option)) - speech_options -= potential_option + speech_options = shuffle(speech_options) + for(var/option in speech_options) + if(carbon.dna.get_mutation(option)) continue - if(carbon.dna.activate_mutation(potential_option)) - speech_option = potential_option - return - else - speech_options -= potential_option - + carbon.dna.add_mutation(option) + speech_option = option + return /datum/reagent/impurity/mannitol/on_mob_delete(mob/living/owner) . = ..() @@ -631,13 +627,11 @@ Basically, we fill the time between now and 2s from now with hands based off the traumalist -= /datum/brain_trauma/severe/split_personality //Uses a ghost, I don't want to use a ghost for a temp thing. traumalist -= /datum/brain_trauma/special/obsessed //Sets the owner as an antag - I presume this will lead to problems, so we'll remove it var/obj/item/organ/brain/brain = owner.getorganslot(ORGAN_SLOT_BRAIN) - while(traumalist || !temp_trauma) - var/datum/brain_trauma/trauma = pick(traumalist) + traumalist = shuffle(traumalist) + for(var/trauma in traumalist) if(brain.brain_gain_trauma(trauma, TRAUMA_RESILIENCE_MAGIC)) temp_trauma = trauma return - else - traumalist -= trauma /datum/reagent/inverse/neurine/on_mob_delete(mob/living/carbon/owner) .=..()