From 86262571b692600643242e2b6379065a2e784519 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Fri, 2 Feb 2024 22:22:10 +0300 Subject: [PATCH] inventory bug fix --- src/frontend/InventoryView.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/frontend/InventoryView.cpp b/src/frontend/InventoryView.cpp index acae9e55..00db92b0 100644 --- a/src/frontend/InventoryView.cpp +++ b/src/frontend/InventoryView.cpp @@ -289,10 +289,11 @@ void SlotView::clicked(gui::GUI* gui, int button) { if (stack.isEmpty()) { stack.set(grabbed); stack.setCount(1); - } else { + grabbed.setCount(grabbed.getCount()-1); + } else if (stack.accepts(grabbed)){ stack.setCount(stack.getCount()+1); + grabbed.setCount(grabbed.getCount()-1); } - grabbed.setCount(grabbed.getCount()-1); } } }