From 030c9ca0859f09f54f901a74f1b93c6ff74656a8 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Mon, 27 May 2024 07:19:13 +0300 Subject: [PATCH] right click item increment fix with stack --- src/graphics/ui/elements/InventoryView.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/graphics/ui/elements/InventoryView.cpp b/src/graphics/ui/elements/InventoryView.cpp index bcfea371..a50f45df 100644 --- a/src/graphics/ui/elements/InventoryView.cpp +++ b/src/graphics/ui/elements/InventoryView.cpp @@ -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); }