From 4eef8b5e84982a754d3a49507dda164ce5a4226c Mon Sep 17 00:00:00 2001 From: snowleo Date: Fri, 19 Jul 2013 01:01:52 +0200 Subject: Can't sell negative amount of items. --- Essentials/src/com/earth2me/essentials/commands/Commandsell.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java index 386aac603..c4931c00a 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java @@ -82,12 +82,12 @@ public class Commandsell extends EssentialsCommand throw new Exception(_("itemCannotBeSold")); } - BigDecimal result = worth.multiply(BigDecimal.valueOf(amount)); - - if (amount == 0) + if (amount <= 0) { - return result; + return BigDecimal.ZERO; } + + BigDecimal result = worth.multiply(BigDecimal.valueOf(amount)); //TODO: Prices for Enchantments final ItemStack ris = is.clone(); -- cgit v1.2.3