From f6ab0de5af54fac36a6f67a83b02ec809988c554 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 26 Nov 2024 08:53:32 +0300 Subject: [PATCH] update Inventory::move --- src/items/Inventory.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/items/Inventory.cpp b/src/items/Inventory.cpp index 282f361f..00d74e53 100644 --- a/src/items/Inventory.cpp +++ b/src/items/Inventory.cpp @@ -37,6 +37,12 @@ void Inventory::move( ItemStack& item, const ContentIndices* indices, size_t begin, size_t end ) { end = std::min(slots.size(), end); + for (size_t i = begin; i < end && !item.isEmpty(); i++) { + ItemStack& slot = slots[i]; + if (!slot.isEmpty() && slot.accepts(item)) { + slot.move(item, indices); + } + } for (size_t i = begin; i < end && !item.isEmpty(); i++) { ItemStack& slot = slots[i]; if (slot.accepts(item)) {