Fix detection of negative modifiers (#1847)

This commit is contained in:
Carlos Fernandez 2026-05-01 14:54:18 -04:00 committed by GitHub
parent 404640a0a3
commit b22ce9697d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -257,7 +257,7 @@ export default class DHRoll extends Roll {
if (!roll.terms[i].isDeterministic) continue; if (!roll.terms[i].isDeterministic) continue;
const termTotal = roll.terms[i].total; const termTotal = roll.terms[i].total;
if (typeof termTotal === 'number') { if (typeof termTotal === 'number') {
const multiplier = roll.terms[i - 1]?.operator === ' - ' ? -1 : 1; const multiplier = roll.terms[i - 1]?.operator === '-' ? -1 : 1;
modifierTotal += multiplier * termTotal; modifierTotal += multiplier * termTotal;
} }
} }