mirror of
https://github.com/raeleus/Hashtag-DnD.git
synced 2025-07-05 21:20:27 -04:00
Fixed crash when attack has no parameter. Resolves #11
This commit is contained in:
parent
1ee6567161
commit
f0fbc94cae
1 changed files with 4 additions and 0 deletions
4
Input.js
4
Input.js
|
@ -1063,6 +1063,10 @@ function doAttack(command) {
|
|||
else difficultyText = difficultyText.toLowerCase()
|
||||
|
||||
var targetText = getArgumentRemainder(command, textIndex)
|
||||
if (targetText == null) {
|
||||
state.show = "none"
|
||||
return "\n[Error: Not enough parameters. See #help]\n"
|
||||
}
|
||||
var toMatches = targetText.match(/^to\s+/gi)
|
||||
if (toMatches != null) targetText = targetText.substring(toMatches[0].length)
|
||||
targetText = stripPunctuation(targetText)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue