diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/Dialogs.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/Dialogs.java index 04f12e368..603da3d2b 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/Dialogs.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/Dialogs.java @@ -178,13 +178,15 @@ public final class Dialogs { public void onItemClick(AdapterView parent, View v, int position, long id) { final String itemTypeID = ((ItemContainerAdapter) parent.getAdapter()).getItem(position).itemType.id; + boolean removeFromCombinedLoot = true; for (Loot l : lootBags) { + if (l == combinedLoot) removeFromCombinedLoot = false; if (l.items.removeItem(itemTypeID)) { controllers.itemController.removeLootBagIfEmpty(l); break; } } - combinedLoot.items.removeItem(itemTypeID); + if (removeFromCombinedLoot) combinedLoot.items.removeItem(itemTypeID); ItemType type = world.itemTypes.getItemType(itemTypeID); world.model.player.inventory.addItem(type); ((ItemContainerAdapter) itemList.getAdapter()).notifyDataSetChanged();