12.0.29 - L'indexation d'Astrobazzarh #732

Merged
uberwald merged 6 commits from VincentVk/foundryvtt-reve-de-dragon:v11 into v11 2024-12-17 07:12:00 +01:00
Showing only changes of commit 1f564e0d89 - Show all commits

View File

@ -491,8 +491,7 @@ export class RdDStatBlockParser {
}
static extractName(actorType, statString) {
switch (actorType) {
case "personnage":
if (actorType == "personnage") {
// Check if ',né le' is present
let namePersonnage = "Importé"
if (statString.includes(", né")) {
@ -505,7 +504,14 @@ export class RdDStatBlockParser {
return Misc.upperFirst(namePersonnage?.value.toLowerCase());
}
}
const name = XRegExp.exec(statString, XRegExp("(?<value>.+)\\s+taille", 'giu'));
if (actorType == "entite") {
if (!(name?.value)) {
const nameEntiteReve = XRegExp.exec(statString, XRegExp("(?<value>.+)\\s+rêve", 'giu'));
return Misc.upperFirst(nameEntiteReve?.value || "Importé");
}
}
return Misc.upperFirst(name?.value || "Importé");
}