From 146c4b795aa4fb0277c7c2ccabf93892ec8076a9 Mon Sep 17 00:00:00 2001 From: Oskar Wiksten Date: Sat, 6 Jul 2013 12:05:03 +0200 Subject: [PATCH] Bugfix: Only remove one item per click when picking up single items from ground bags --- AndorsTrail/src/com/gpl/rpg/AndorsTrail/Dialogs.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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();