mirror of
https://github.com/raeleus/Hashtag-DnD.git
synced 2025-07-05 21:20:27 -04:00
Fixed being unable to use negative modifiers for #roll
This commit is contained in:
parent
ca76856c90
commit
ff64d9006b
2 changed files with 4 additions and 3 deletions
|
@ -200,16 +200,16 @@ function getSides(rolltext) {
|
|||
}
|
||||
|
||||
function getAddition(rolltext) {
|
||||
var matches = rolltext.match(/(?<=(\+|-)\s*)\d+/)
|
||||
var matches = rolltext.match(/(\+|-)\s*\d+/)
|
||||
if (matches != null) {
|
||||
return parseInt(matches[0])
|
||||
return parseInt(matches[0].replaceAll(/\s*/g, ""))
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
function formatRoll(text) {
|
||||
var matches = text.match(/(?<=.*)\d*d\d+(?=.*)(\s*\+\s*\d+)?/)
|
||||
var matches = text.match(/(?<=.*)\d*d\d+(?=.*)(\s*(\+|-)\s*\d+)?/)
|
||||
if (matches != null) {
|
||||
return matches[0].replaceAll(/\s*\+\s*/g, "+").replaceAll(/\s*-\s*/g, "-")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue