mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 13:31: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 "InventoryView.hpp"
|
||||||
|
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
#include <iostream>
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "assets/Assets.hpp"
|
#include "assets/Assets.hpp"
|
||||||
|
|
@ -369,8 +368,14 @@ void SlotView::performLeftClick(ItemStack& stack, ItemStack& grabbed) {
|
||||||
}
|
}
|
||||||
auto& indices = *content->getIndices();
|
auto& indices = *content->getIndices();
|
||||||
if (!layout.itemSource && stack.accepts(grabbed) && layout.placing) {
|
if (!layout.itemSource && stack.accepts(grabbed) && layout.placing) {
|
||||||
action = InteractionAction::PUT;
|
auto& def = indices.items.require(stack.getItemId());
|
||||||
stack.move(grabbed, indices);
|
if (stack.getCount() < def.stackSize) {
|
||||||
|
action = InteractionAction::PUT;
|
||||||
|
stack.move(grabbed, indices);
|
||||||
|
} else {
|
||||||
|
action = InteractionAction::TAKE;
|
||||||
|
std::swap(grabbed, stack);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
actIfCannotPut(stack, grabbed, action);
|
actIfCannotPut(stack, grabbed, action);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue