mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
fix p.5
This commit is contained in:
parent
2c9cb8b3d4
commit
5d66c41f80
1 changed files with 13 additions and 4 deletions
|
|
@ -366,10 +366,10 @@ void SlotView::performLeftClick(ItemStack& stack, ItemStack& grabbed) {
|
|||
);
|
||||
return;
|
||||
}
|
||||
|
||||
auto indices = *content->getIndices();
|
||||
if (!layout.itemSource && stack.accepts(grabbed) && layout.placing) {
|
||||
action = InteractionAction::PUT;
|
||||
stack.move(grabbed, *content->getIndices());
|
||||
stack.move(grabbed, indices);
|
||||
} else {
|
||||
if (layout.itemSource) {
|
||||
if (grabbed.isEmpty()) {
|
||||
|
|
@ -379,8 +379,17 @@ void SlotView::performLeftClick(ItemStack& stack, ItemStack& grabbed) {
|
|||
grabbed.maximizeCount(*content->getIndices());
|
||||
}
|
||||
} else {
|
||||
action = InteractionAction::PUT;
|
||||
grabbed.clear();
|
||||
// TODO: refactor to reduce nesting
|
||||
if (grabbed.accepts(stack)) {
|
||||
auto& def = indices.items.require(stack.getItemId());
|
||||
if (grabbed.getCount() < def.stackSize) {
|
||||
action = InteractionAction::TAKE;
|
||||
grabbed.setCount(grabbed.getCount() + 1);
|
||||
}
|
||||
} else {
|
||||
action = InteractionAction::PUT;
|
||||
grabbed.clear();
|
||||
}
|
||||
}
|
||||
} else if (grabbed.isEmpty()) {
|
||||
if (layout.taking) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue