[fix] global scripts not working

This commit is contained in:
kwaroran
2023-05-26 00:02:39 +09:00
parent 3082b5d223
commit 0badf24b22

View File

@@ -14,7 +14,7 @@ export function processScriptFull(char:character, data:string, mode:ScriptMode){
let db = get(DataBase) let db = get(DataBase)
let emoChanged = false let emoChanged = false
const scripts = char.customscript.concat(db.globalscript ?? []) const scripts = char.customscript.concat(db.globalscript ?? [])
for (const script of char.customscript){ for (const script of scripts){
if(script.type === mode){ if(script.type === mode){
const reg = new RegExp(script.in,'g') const reg = new RegExp(script.in,'g')
data = data.replace(reg, (v) => { data = data.replace(reg, (v) => {