diff --git a/code/datums/brain_damage/hypnosis.dm b/code/datums/brain_damage/hypnosis.dm index 61e59026ebb..d3ce57ca672 100644 --- a/code/datums/brain_damage/hypnosis.dm +++ b/code/datums/brain_damage/hypnosis.dm @@ -7,11 +7,17 @@ resilience = TRAUMA_RESILIENCE_SURGERY var/hypnotic_phrase = "" + var/regex/target_phrase /datum/brain_trauma/hypnosis/New(phrase) if(!phrase) qdel(src) hypnotic_phrase = phrase + try + target_phrase = new("(\\b[hypnotic_phrase]\\b)","ig") + catch(var/exception/e) + stack_trace("[e] on [e.file]:[e.line]") + qdel(src) ..() /datum/brain_trauma/hypnosis/on_gain() @@ -43,6 +49,5 @@ new /datum/hallucination/chat(owner, TRUE, FALSE, "[hypnotic_phrase]") /datum/brain_trauma/hypnosis/on_hear(message, speaker, message_language, raw_message, radio_freq) - var/regex/target_phrase = new("(\\b[hypnotic_phrase]\\b)","ig") message = target_phrase.Replace(message, "$1") - return message \ No newline at end of file + return message