mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21:49 +00:00
fix p.13
This commit is contained in:
parent
b50531895c
commit
242c59d73c
1 changed files with 8 additions and 3 deletions
|
|
@ -1,7 +1,6 @@
|
|||
#include "InventoryView.hpp"
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <iostream>
|
||||
#include <utility>
|
||||
|
||||
#include "assets/Assets.hpp"
|
||||
|
|
@ -369,8 +368,14 @@ void SlotView::performLeftClick(ItemStack& stack, ItemStack& grabbed) {
|
|||
}
|
||||
auto& indices = *content->getIndices();
|
||||
if (!layout.itemSource && stack.accepts(grabbed) && layout.placing) {
|
||||
action = InteractionAction::PUT;
|
||||
stack.move(grabbed, indices);
|
||||
auto& def = indices.items.require(stack.getItemId());
|
||||
if (stack.getCount() < def.stackSize) {
|
||||
action = InteractionAction::PUT;
|
||||
stack.move(grabbed, indices);
|
||||
} else {
|
||||
action = InteractionAction::TAKE;
|
||||
std::swap(grabbed, stack);
|
||||
}
|
||||
} else {
|
||||
actIfCannotPut(stack, grabbed, action);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue