mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
right click item increment fix with stack
This commit is contained in:
parent
e8a703f814
commit
030c9ca085
1 changed files with 2 additions and 1 deletions
|
|
@ -253,11 +253,12 @@ void SlotView::clicked(gui::GUI* gui, mousecode button) {
|
|||
stack.setCount(halfremain);
|
||||
}
|
||||
} else {
|
||||
auto stackDef = content->getIndices()->getItemDef(stack.getItemId());
|
||||
if (stack.isEmpty()) {
|
||||
stack.set(grabbed);
|
||||
stack.setCount(1);
|
||||
grabbed.setCount(grabbed.getCount()-1);
|
||||
} else if (stack.accepts(grabbed)){
|
||||
} else if (stack.accepts(grabbed) && stack.getCount() < stackDef->stackSize){
|
||||
stack.setCount(stack.getCount()+1);
|
||||
grabbed.setCount(grabbed.getCount()-1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue