mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
Inventory: Fix picking up items via drop and pickup doubleclick (#13891)
This commit is contained in:
parent
5e0f14266d
commit
3c41195986
@ -4420,9 +4420,10 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
|
||||
}
|
||||
}
|
||||
} else if (button == BET_LEFT && (empty || matching)) {
|
||||
// We don't know if the user is left-dragging or just moving
|
||||
// the item, so assume that they are left-dragging,
|
||||
// and wait for the next event before moving the item
|
||||
// We don't know if the user is left-dragging, just moving
|
||||
// the item, or doing a pickup-all via doubleclick, so assume
|
||||
// that they are left-dragging, and wait for the next event
|
||||
// before moving the item, or doing a pickup-all
|
||||
m_left_dragging = true;
|
||||
m_client->inhibit_inventory_revert = true;
|
||||
m_left_drag_stack = list_selected->getItem(m_selected_item->i);
|
||||
@ -4572,6 +4573,13 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
|
||||
if (!s.isValid() || event.MouseInput.Event != EMIE_LMOUSE_DOUBLE_CLICK)
|
||||
break;
|
||||
|
||||
// Only do the pickup all thing when putting down an item.
|
||||
// Doubleclick events are triggered after press-down events, so if
|
||||
// m_left_dragging is true here, the user just put down an itemstack,
|
||||
// but didn't yet release the button to make it happen.
|
||||
if (!m_left_dragging)
|
||||
break;
|
||||
|
||||
// Abort left-dragging
|
||||
m_left_dragging = false;
|
||||
m_client->inhibit_inventory_revert = false;
|
||||
|
Loading…
Reference in New Issue
Block a user