mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
update Inventory::move
This commit is contained in:
parent
af185a5a40
commit
f6ab0de5af
1 changed files with 6 additions and 0 deletions
|
|
@ -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)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue