Fix Dupe bug...... why was this overlooked?

This commit is contained in:
T00thpick1 2013-08-03 11:34:55 -04:00
parent d5dc9895e4
commit 4ea3d690db

View File

@ -29,9 +29,9 @@ public class Unarmed {
public static boolean handleItemPickup(PlayerInventory inventory, Item drop) {
ItemStack dropStack = drop.getItemStack();
int firstEmpty = inventory.firstEmpty();
int dropAmount = dropStack.getAmount();
if (inventory.containsAtLeast(dropStack, 1)) {
int dropAmount = dropStack.getAmount();
int nextSlot = 0;
for (Iterator<ItemStack> iterator = inventory.iterator(); iterator.hasNext();) {
@ -72,6 +72,7 @@ public class Unarmed {
if (itemstack == null) {
drop.remove();
dropStack.setAmount(dropAmount);
inventory.setItem(nextSlot, dropStack);
return true;
}
@ -80,6 +81,8 @@ public class Unarmed {
}
}
dropStack.setAmount(dropAmount); // Even when only partially finished we need to prevent dupes
return false;
}
}