From 47d96b643e75c2d3a80ce7508bb9a1b6599666a4 Mon Sep 17 00:00:00 2001 From: raeleus Date: Wed, 25 Sep 2024 22:47:54 -0700 Subject: [PATCH] Fixed minor errors in drop. --- Input.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Input.js b/Input.js index 6d41832..ae5f38c 100644 --- a/Input.js +++ b/Input.js @@ -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` } }