From b21a97434278eaeb8dfef806ab563f9f2b56842a Mon Sep 17 00:00:00 2001 From: sfence Date: Tue, 21 May 2024 15:38:12 +0200 Subject: [PATCH] Fix inventory: Quickly picking up item and placing it again no longer works (#14657) --- src/gui/guiFormSpecMenu.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gui/guiFormSpecMenu.cpp b/src/gui/guiFormSpecMenu.cpp index 577e2ee68..2e54b32dc 100644 --- a/src/gui/guiFormSpecMenu.cpp +++ b/src/gui/guiFormSpecMenu.cpp @@ -4625,11 +4625,6 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event) if (!m_left_dragging) break; - // Abort left-dragging - m_left_dragging = false; - m_client->inhibit_inventory_revert = false; - m_left_drag_stacks.clear(); - // Both the selected item and the hovered item need to be checked // because we don't know exactly when the double-click happened ItemStack slct; @@ -4658,6 +4653,12 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event) } if (amount > 0) { + if (m_left_dragging) { + // Abort left-dragging + m_left_dragging = false; + m_client->inhibit_inventory_revert = false; + m_left_drag_stacks.clear(); + } IMoveAction *a = new IMoveAction(); a->count = amount; a->from_inv = s.inventoryloc;