Fixed minor errors in drop.

This commit is contained in:
raeleus 2024-09-25 22:47:54 -07:00
parent 3fa78a82f0
commit 47d96b643e

View file

@ -1187,7 +1187,7 @@ function doDrop(command) {
var existingItem = character.inventory[index]
if (item.quantity == 1) text = `\n${character.name} ${commandName} the ${displayItemName}.\n`
else if (item.quantity >= existingItem.quantity) text = `${character.name} ${commandName} all of the ${displayItemName}.`
else if (parseInt(item.quantity) >= parseInt(existingItem.quantity)) text = `${character.name} ${commandName} all of the ${displayItemName}.`
else text = `\n${character.name} ${commandName} ${item.quantity} ${displayItemName}.\n`
existingItem.quantity -= item.quantity
@ -1197,7 +1197,7 @@ function doDrop(command) {
}
if (existingItem.quantity > 0) {
displayItemName = existingItem.name.plural(existingItem.quantity == 1)
text += `${character.name} now ${haveWord} ${existingItem.quantity} ${displayItemName}.\n`
text += ` ${character.name} now ${haveWord} ${existingItem.quantity} ${displayItemName}.\n`
}
}