From 64be1078e1b12ad48d18bef90b0862a93c0d8b1d Mon Sep 17 00:00:00 2001 From: Pallando Date: Sun, 10 Nov 2024 13:00:39 +0100 Subject: [PATCH] Fix babele-register.js for subskills when core is not first compendium checked --- modules/babele-register.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/babele-register.js b/modules/babele-register.js index 004ec3f..7779d25 100644 --- a/modules/babele-register.js +++ b/modules/babele-register.js @@ -257,8 +257,12 @@ Hooks.once('init', () => { s1 = res[1].trim() + " ( )"; translItem = game.babele.translate(compData.metadata.id, { name: s1, type: "skill" }, true) translw = translItem?.name || undefined - let res2 = re.exec(translw); - transl = res2[1] + "(" + subword + ")"; + if(translw) { + let res2 = re.exec(translw); + transl = res2[1] + "(" + subword + ")"; + } else { + transl = res[1] + " (" + subword + ")"; + } } } }