Fix import de creatures sans heure de naissance
This commit is contained in:
		| @@ -377,8 +377,14 @@ export class RdDStatBlockParser { | ||||
|   static extractName(actorType, statString) { | ||||
|     switch (actorType) { | ||||
|       case "personnage": | ||||
|         // Name is all string before first comma ',' | ||||
|         const namePersonnage = XRegExp.exec(statString, XRegExp("(?<value>[\\p{Letter}\\s\\d]+),", 'giu')); | ||||
|         // Check if ',né le' is present  | ||||
|         let namePersonnage = "Importé" | ||||
|         if (statString.match(/, né le/)) { | ||||
|           // Name is all string before first comma ',' | ||||
|           namePersonnage = XRegExp.exec(statString, XRegExp("(?<value>[\\p{Letter}\\s\\d]+),", 'giu')); | ||||
|         } else { | ||||
|           namePersonnage = XRegExp.exec(statString, XRegExp("(?<value>[\\p{Letter}\\s\\d]+)\\s+TAILLE", 'giu')); | ||||
|         } | ||||
|         if (namePersonnage?.value) { | ||||
|           return Misc.upperFirst(namePersonnage?.value); | ||||
|         } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user