mirror of
https://github.com/raeleus/Hashtag-DnD.git
synced 2025-07-05 21:20:27 -04:00
Resolve issues with casted spells being repeated twice.
This commit is contained in:
parent
c15f5c9dd4
commit
f7a29c57b1
1 changed files with 9 additions and 5 deletions
14
Input.js
14
Input.js
|
@ -1481,11 +1481,15 @@ function doCastSpell(command) {
|
|||
if (!/^((at)|(on))\s+.*/.test(target)) target = "at " + target
|
||||
}
|
||||
} else {
|
||||
var remainder = getArgumentRemainder(command, spellIndex)
|
||||
spell = remainder.replace(/\s+((at)|(on)).*/i, "").trim()
|
||||
if (/.*\s((at)|(on))\s.*/i.test(spell)) {
|
||||
var remainder = getArgumentRemainder(command, spellIndex)
|
||||
spell = remainder.replace(/\s+((at)|(on)).*/i, "").trim()
|
||||
target = remainder.replace(/^.*\s+(?=(at)|(on))/i, "").trim()
|
||||
} else {
|
||||
spell = getArgumentRemainder(command, spellIndex).trim()
|
||||
}
|
||||
|
||||
found = character.spells.find(x => x.toLowerCase() == spell.toLowerCase())
|
||||
|
||||
target = remainder.replace(/^.*\s+(?=(at)|(on))/i, "").trim()
|
||||
}
|
||||
|
||||
if (found == null) {
|
||||
|
@ -1622,4 +1626,4 @@ function doHelp(command) {
|
|||
return " "
|
||||
}
|
||||
|
||||
modifier(text)
|
||||
modifier(text)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue