All decimals in custom dice
This commit is contained in:
		
							parent
							
								
									30f0314695
								
							
						
					
					
						commit
						156f3d528f
					
				| 
						 | 
					@ -168,9 +168,11 @@ export const getModifiers = (args: string[]): [RollModifiers, string[]] => {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          if (reservedCharacters.some((char) => name.includes(char))) {
 | 
					          if (reservedCharacters.some((char) => name.includes(char))) {
 | 
				
			||||||
            modifiers.error.name = 'InvalidCharacterInCDName';
 | 
					            modifiers.error.name = 'InvalidCharacterInCDName';
 | 
				
			||||||
            modifiers.error.message = `Custom dice names cannot include any of the following characters:\n${JSON.stringify(
 | 
					            modifiers.error.message = `Custom dice names cannot include any of the following characters:\n${
 | 
				
			||||||
              reservedCharacters
 | 
					              JSON.stringify(
 | 
				
			||||||
            )}\n\n${cdSyntaxMessage}`;
 | 
					                reservedCharacters,
 | 
				
			||||||
 | 
					              )
 | 
				
			||||||
 | 
					            }\n\n${cdSyntaxMessage}`;
 | 
				
			||||||
            modifiers.valid = false;
 | 
					            modifiers.valid = false;
 | 
				
			||||||
            return [modifiers, args];
 | 
					            return [modifiers, args];
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
| 
						 | 
					@ -180,7 +182,7 @@ export const getModifiers = (args: string[]): [RollModifiers, string[]] => {
 | 
				
			||||||
            .replaceAll(']', '')
 | 
					            .replaceAll(']', '')
 | 
				
			||||||
            .split(',')
 | 
					            .split(',')
 | 
				
			||||||
            .filter((x) => x)
 | 
					            .filter((x) => x)
 | 
				
			||||||
            .map((side) => parseInt(side));
 | 
					            .map((side) => parseFloat(side));
 | 
				
			||||||
          if (!sides.length) {
 | 
					          if (!sides.length) {
 | 
				
			||||||
            modifiers.error.name = 'NoCustomSidesSpecified';
 | 
					            modifiers.error.name = 'NoCustomSidesSpecified';
 | 
				
			||||||
            modifiers.error.message = `No sides found for \`${name}\`.\n\n${cdSyntaxMessage}`;
 | 
					            modifiers.error.message = `No sides found for \`${name}\`.\n\n${cdSyntaxMessage}`;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue