mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 06:51:51 +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
|
ItemStack& item, const ContentIndices* indices, size_t begin, size_t end
|
||||||
) {
|
) {
|
||||||
end = std::min(slots.size(), 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++) {
|
for (size_t i = begin; i < end && !item.isEmpty(); i++) {
|
||||||
ItemStack& slot = slots[i];
|
ItemStack& slot = slots[i];
|
||||||
if (slot.accepts(item)) {
|
if (slot.accepts(item)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue