1
1
mirror of https://github.com/Burn-E99/TheArtificer.git synced 2026-01-06 20:37:54 -05:00

fix -number check to identify +-1 and collapse the +-1 into "+" and "-1" instead of "+" "-" and "1"

This commit is contained in:
Ean Milligan
2025-05-03 17:06:38 -04:00
parent d094efb279
commit d142b35522

View File

@ -125,7 +125,7 @@ export const tokenizeMath = (cmd: string, modifiers: RollModifiers): [ReturnData
}
// Identify if we are in a state where the current number is a negative number
if (mathConf[i - 1] === '-' && ((!mathConf[i - 2] && mathConf[i - 2] !== 0) || mathConf[i - 2] === '(')) {
if (mathConf[i - 1] === '-' && ((!mathConf[i - 2] && mathConf[i - 2] !== 0) || operators.includes(<string> mathConf[i - 2]))) {
if (typeof mathConf[i] === 'string') {
// Current item is a mathOp, need to insert a "-1 *" before it
mathConf.splice(i - 1, 1, ...[parseFloat('-1'), '*']);