mirror of
https://github.com/Kornstalx/5etools-mirror-2.github.io.git
synced 2026-01-14 05:47:50 -06:00
v1.199.2
This commit is contained in:
@@ -152,7 +152,7 @@ class CreatureParser extends BaseParser {
|
||||
// name of monster
|
||||
if (meta.ixToConvert === 0) {
|
||||
// region
|
||||
const mCr = /^(?<name>.*)\s+(?<cr>CR \d+(?:\/\d+)? .*$)/.exec(meta.curLine);
|
||||
const mCr = /^(?<name>.*)\s+(?<cr>CR (?:\d+(?:\/\d+)?|[⅛¼½]) .*$)/.exec(meta.curLine);
|
||||
if (mCr) {
|
||||
meta.curLine = mCr.groups.name;
|
||||
meta.toConvert.splice(meta.ixToConvert + 1, 0, mCr.groups.cr);
|
||||
@@ -1772,6 +1772,10 @@ class CreatureParser extends BaseParser {
|
||||
|
||||
if (!line) return;
|
||||
|
||||
if (/^[⅛¼½]$/.test(line)) {
|
||||
line = Parser.numberToCr(Parser.vulgarToNumber(line));
|
||||
}
|
||||
|
||||
if (!/^(\d+\/\d+|\d+)$/.test(line)) {
|
||||
cbWarning(`${stats.name ? `(${stats.name}) ` : ""}CR requires manual conversion "${line}"`);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user