mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 14:01:49 +00:00
remove redundant allocations
This commit is contained in:
parent
047f050364
commit
b50531895c
1 changed files with 3 additions and 3 deletions
|
|
@ -367,7 +367,7 @@ void SlotView::performLeftClick(ItemStack& stack, ItemStack& grabbed) {
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
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;
|
action = InteractionAction::PUT;
|
||||||
stack.move(grabbed, indices);
|
stack.move(grabbed, indices);
|
||||||
|
|
@ -387,13 +387,13 @@ void SlotView::performLeftClick(ItemStack& stack, ItemStack& grabbed) {
|
||||||
|
|
||||||
void SlotView::actIfCannotPut(ItemStack& stack, ItemStack& grabbed, InteractionAction& action) {
|
void SlotView::actIfCannotPut(ItemStack& stack, ItemStack& grabbed, InteractionAction& action) {
|
||||||
const auto& input = gui.getInput();
|
const auto& input = gui.getInput();
|
||||||
auto indices = *content->getIndices();
|
auto& indices = *content->getIndices();
|
||||||
if (layout.itemSource) {
|
if (layout.itemSource) {
|
||||||
if (grabbed.isEmpty()) {
|
if (grabbed.isEmpty()) {
|
||||||
action = InteractionAction::TAKE;
|
action = InteractionAction::TAKE;
|
||||||
grabbed.set(stack);
|
grabbed.set(stack);
|
||||||
if (input.pressed(Keycode::LEFT_CONTROL)) {
|
if (input.pressed(Keycode::LEFT_CONTROL)) {
|
||||||
grabbed.maximizeCount(*content->getIndices());
|
grabbed.maximizeCount(indices);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (grabbed.accepts(stack)) {
|
if (grabbed.accepts(stack)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue