Lavaeolous / PF1-StatBlock-Converter-Module

FoundryVTT Module to convert PF1 Statblocks into Foundry Actors (PC or NPC).
MIT License
14 stars 12 forks source link

parseBase Triggers mythic rank parse when "MR" in character name. #479

Closed djhall1 closed 2 years ago

djhall1 commented 3 years ago

When pasting names with "MR" included (e.g. "VALE TEMROS") copied from pathfinder PDFs an uncaught TypeError occurs. Issue appears to be due to the following snippet in parseBase:

// Parse Mythic Rank (uses notesParser, as mr currently is not supported by FVTT PF1) if (!parsedSubCategories["mr"]) { if (lineContent.search(/\sMR\s/) !== -1) { let parserMR = sbcMapping.map.base.mr let mr = lineContent.match(/\sMR\s(\d+)/)[1].trim() parsedSubCategories["mr"] = await parserMR.parse(mr, line)

Changing name to lowercase appears to solve issue, but seems to occur to any name with capital "MR" included in the name.