We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 244121b commit 0c08f94Copy full SHA for 0c08f94
src/gui/guiInventoryList.cpp
@@ -176,7 +176,14 @@ bool GUIInventoryList::OnEvent(const SEvent &event)
176
Environment->getRootGUIElement()->getElementFromPoint(
177
core::position2d<s32>(event.MouseInput.X, event.MouseInput.Y));
178
179
- bool ret = hovered && hovered->OnEvent(event);
+ // if the player clicks outside of the formspec window, hovered is not
180
+ // m_fs_menu, but some other weird element (with ID -1). we do however need
181
+ // hovered to be m_fs_menu as item dropping when clicking outside of the
182
+ // formspec window is handled in its OnEvent callback
183
+ if (!hovered || hovered->getID() == -1)
184
+ hovered = m_fs_menu;
185
+
186
+ bool ret = hovered->OnEvent(event);
187
188
IsVisible = was_visible;
189
0 commit comments