[MIRROR] Prevent phobias being triggered by words you don't understand (#2221)

* prevent phobias being triggered by words you don't understand (#55580)

* Prevent phobias being triggered by words you don't understand

Co-authored-by: dragomagol <66640614+dragomagol@users.noreply.github.com>
This commit is contained in:
SkyratBot
2020-12-18 08:53:26 +01:00
committed by GitHub
co-authored by dragomagol
parent 665a91650d
commit 6fc3910142
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -78,6 +78,8 @@
return
if(HAS_TRAIT(owner, TRAIT_FEARLESS))
return
if(!owner.has_language(hearing_args[HEARING_LANGUAGE])) //can't be triggered if you don't know the language
return
if(trigger_regex.Find(hearing_args[HEARING_RAW_MESSAGE]) != 0)
addtimer(CALLBACK(src, .proc/freak_out, null, trigger_regex.group[2]), 10) //to react AFTER the chat message
hearing_args[HEARING_RAW_MESSAGE] = trigger_regex.Replace(hearing_args[HEARING_RAW_MESSAGE], "<span class='phobia'>$2</span>$3")