mirror of
https://github.com/OMGeeky/andors-trail.git
synced 2026-01-23 03:39:10 +01:00
Fixed an issue that prevented quickslots quantities from being updated
when you loot an item that goes there. (Reapplied changes in commit missed during quickslots_custom_ui merge)
This commit is contained in:
@@ -210,6 +210,7 @@ public final class ItemController {
|
||||
public void pickupAll(Loot loot) {
|
||||
world.model.player.inventory.add(loot.items);
|
||||
consumeNonItemLoot(loot);
|
||||
checkQuickslotItemLooted(loot.items);
|
||||
loot.clear();
|
||||
}
|
||||
public void pickupAll(Iterable<Loot> lootBags) {
|
||||
@@ -352,4 +353,18 @@ public final class ItemController {
|
||||
world.model.player.inventory.quickitem[quickSlotId] = itemType;
|
||||
quickSlotListeners.onQuickSlotChanged(quickSlotId);
|
||||
}
|
||||
|
||||
private void checkQuickslotItemLooted(ItemContainer items) {
|
||||
for (ItemEntry item : items.items) {
|
||||
if (item.itemType.isUsable()) {
|
||||
for (int i = 0; i < world.model.player.inventory.quickitem.length; i++) {
|
||||
if (item.itemType == world.model.player.inventory.quickitem[i]) {
|
||||
quickSlotListeners.onQuickSlotChanged(i);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user