From 156f3d528f59f7b8ae19c1e2ba02168c54c0d454 Mon Sep 17 00:00:00 2001 From: Ean Milligan Date: Wed, 9 Jul 2025 13:13:04 -0400 Subject: [PATCH] All decimals in custom dice --- src/artigen/dice/getModifiers.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/artigen/dice/getModifiers.ts b/src/artigen/dice/getModifiers.ts index f6ee66c..7d77bb2 100644 --- a/src/artigen/dice/getModifiers.ts +++ b/src/artigen/dice/getModifiers.ts @@ -168,9 +168,11 @@ export const getModifiers = (args: string[]): [RollModifiers, string[]] => { if (reservedCharacters.some((char) => name.includes(char))) { modifiers.error.name = 'InvalidCharacterInCDName'; - modifiers.error.message = `Custom dice names cannot include any of the following characters:\n${JSON.stringify( - reservedCharacters - )}\n\n${cdSyntaxMessage}`; + modifiers.error.message = `Custom dice names cannot include any of the following characters:\n${ + JSON.stringify( + reservedCharacters, + ) + }\n\n${cdSyntaxMessage}`; modifiers.valid = false; return [modifiers, args]; } @@ -180,7 +182,7 @@ export const getModifiers = (args: string[]): [RollModifiers, string[]] => { .replaceAll(']', '') .split(',') .filter((x) => x) - .map((side) => parseInt(side)); + .map((side) => parseFloat(side)); if (!sides.length) { modifiers.error.name = 'NoCustomSidesSpecified'; modifiers.error.message = `No sides found for \`${name}\`.\n\n${cdSyntaxMessage}`;