summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2013-02-17 15:10:41 +0100
committersnowleo <schneeleo@gmail.com>2013-02-17 15:10:41 +0100
commitce9e630072949808f7e9cae79623e4ec6e040a62 (patch)
treeb1f533c6a7c926097c0353ddf7e5c6fc6b8f62ae
parentef063c255ed2117e0dfee88c3af0e117a4c2f2f4 (diff)
downloadEssentials-ce9e630072949808f7e9cae79623e4ec6e040a62.tar
Essentials-ce9e630072949808f7e9cae79623e4ec6e040a62.tar.gz
Essentials-ce9e630072949808f7e9cae79623e4ec6e040a62.tar.lz
Essentials-ce9e630072949808f7e9cae79623e4ec6e040a62.tar.xz
Essentials-ce9e630072949808f7e9cae79623e4ec6e040a62.zip
Fix all removeItem()
This could fix some broken logging of selling items
-rw-r--r--Essentials/src/com/earth2me/essentials/Trade.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsell.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Trade.java b/Essentials/src/com/earth2me/essentials/Trade.java
index 1a03a0145..3d51c5aa4 100644
--- a/Essentials/src/com/earth2me/essentials/Trade.java
+++ b/Essentials/src/com/earth2me/essentials/Trade.java
@@ -169,7 +169,7 @@ public class Trade
{
throw new ChargeException(_("missingItems", getItemStack().getAmount(), getItemStack().getType().toString().toLowerCase(Locale.ENGLISH).replace("_", " ")));
}
- user.getInventory().removeItem(getItemStack());
+ user.getInventory().removeItem(getItemStack().clone());
user.updateInventory();
}
if (command != null)
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
index a7b1ae32d..b238361b2 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
@@ -157,7 +157,7 @@ public class Commandsell extends EssentialsCommand
// This should never happen.
throw new IllegalStateException("Trying to remove more items than are available.");
}
- user.getInventory().removeItem(ris);
+ user.getInventory().removeItem(ris.clone());
user.updateInventory();
Trade.log("Command", "Sell", "Item", user.getName(), new Trade(ris, ess), user.getName(), new Trade(worth * amount, ess), user.getLocation(), ess);
user.giveMoney(worth * amount);