mirror of
https://github.com/raeleus/Hashtag-DnD.git
synced 2025-07-05 21:20:27 -04:00
Fixed #drop detecting all at incorrect times. Also fixes plural form of the command. Resolves #35
This commit is contained in:
parent
6b82087d7f
commit
650483ae7a
2 changed files with 8 additions and 4 deletions
8
Input.js
8
Input.js
|
@ -1484,7 +1484,7 @@ function doDrop(command) {
|
|||
|
||||
var itemArgIndex = 0
|
||||
if (isNaN(arg0)) {
|
||||
if (allSynonyms.indexOf(arg0.toLowerCase() > -1)) {
|
||||
if (allSynonyms.indexOf(arg0.toLowerCase()) > -1) {
|
||||
arg0 = Number.MAX_SAFE_INTEGER
|
||||
itemArgIndex++
|
||||
} else {
|
||||
|
@ -1511,9 +1511,9 @@ function doDrop(command) {
|
|||
} else {
|
||||
var existingItem = character.inventory[index]
|
||||
|
||||
if (existingItem.quantity == 1) text = `\n${character.name} ${commandName} the ${displayItemName.plural(true)}.\n`
|
||||
else if (parseInt(item.quantity) >= parseInt(existingItem.quantity)) text = `${character.name} ${commandName} all ${existingItem.quantity} of the ${displayItemName}.`
|
||||
else text = `\n${character.name} ${commandName} ${item.quantity} ${displayItemName}.\n`
|
||||
if (existingItem.quantity == 1) text = `\n${character.name} ${commandName.plural(character.name == "You")} the ${displayItemName.plural(true)}.\n`
|
||||
else if (parseInt(item.quantity) >= parseInt(existingItem.quantity)) text = `${character.name} ${commandName.plural(character.name == "You")} all ${existingItem.quantity} of the ${displayItemName}.`
|
||||
else text = `\n${character.name} ${commandName.plural(character.name == "You")} ${item.quantity} ${displayItemName}.\n`
|
||||
|
||||
existingItem.quantity -= item.quantity
|
||||
if (existingItem.quantity <= 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue