mirror of
https://github.com/OMGeeky/andors-trail.git
synced 2026-02-23 15:38:29 +01:00
Bugfix: Only remove one item per click when picking up single items from ground bags
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user