From d5686b81edecc00c5df2cab446d0105ebce86109 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 6 Dec 2024 22:58:37 +0100 Subject: [PATCH] Ajout "kg" au poids --- module/apps/rdd-import-stats.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/module/apps/rdd-import-stats.js b/module/apps/rdd-import-stats.js index 63209789..cd05e1e8 100644 --- a/module/apps/rdd-import-stats.js +++ b/module/apps/rdd-import-stats.js @@ -110,7 +110,7 @@ export class RdDStatBlockParser { name = name.replace("Voie d'", ""); name = name.replace("Voie de ", ""); return name - } + } static async parseStatBlock(statString) { @@ -211,16 +211,16 @@ export class RdDStatBlockParser { } } - // Now process armors - const armors = await SystemCompendiums.getWorldOrCompendiumItems("armure", "equipement") - for (let armor of armors) { - let matchArmor = XRegExp.exec(statString, XRegExp(armor.name, 'giu')); - if (matchArmor) { - armor = armor.toObject() - armor.system.equipe = true - items.push(armor); + // Now process armors + const armors = await SystemCompendiums.getWorldOrCompendiumItems("armure", "equipement") + for (let armor of armors) { + let matchArmor = XRegExp.exec(statString, XRegExp(armor.name, 'giu')); + if (matchArmor) { + armor = armor.toObject() + armor.system.equipe = true + items.push(armor); + } } - } if (type == "personnage") { @@ -322,7 +322,7 @@ export class RdDStatBlockParser { actorData.taille = taille.value; } // Get weight - const poids = XRegExp.exec(statString, XRegExp("(?\\d+) kg", 'giu')); + const poids = XRegExp.exec(statString, XRegExp("(?\\d+ kg)", 'giu')); if (poids?.value) { actorData.poids = poids.value; } @@ -387,7 +387,7 @@ export class RdDStatBlockParser { case "personnage": // Check if ',né le' is present let namePersonnage = "Importé" - if ( statString.includes(", né") ) { + if (statString.includes(", né")) { // Name is all string before first comma ',' namePersonnage = XRegExp.exec(statString, XRegExp("(?[\\p{Letter}\\s\\d]+),", 'giu')); } else {