Fix: Dropping items outside of inventory menus#1159
Open
Adem-Kurt wants to merge 2 commits intosmartcmd:mainfrom
Open
Fix: Dropping items outside of inventory menus#1159Adem-Kurt wants to merge 2 commits intosmartcmd:mainfrom
Adem-Kurt wants to merge 2 commits intosmartcmd:mainfrom
Conversation
Contributor
Author
2026-03-11.22-29-27.mp4 |
|
Tested your branch, looks like there's a problem in the creative menu where some items don't get dropped even when the count reduces, leading to some getting lost. Doesn't look to be an issue in the inventory. adem-kurt-1159-pull.mp4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes two separate bugs that prevented players from dropping items with clicking outside the inventory in menus.
Changes
Previous Behavior
Root Cause
IUIScene_CreativeMenu.cpp,handleValidKeyPresshad a check that captured any right-click (buttonNum == 1) and triggered the hotbar clearing function, terminating the input flow before the outside drop logic could process it.AbstractContainerMenu.cpp, theclickedfunction had an early bounds check (if (slotIndex < 0 || slotIndex >= slots.size()) return nullptr;). Because clicking outside the UI sends a slot ID ofSLOT_CLICKED_OUTSIDE(-999), this early check blocked the input, never allowing the drop code to execute.New Behavior
Fix Implementation
!m_bPointerOutsideMenuto the right-click interception logic inIUIScene_CreativeMenu.cppso it only clears the hotbar if the pointer is actually inside the UI boundaries.SLOT_CLICKED_OUTSIDEin the initial boundary bounds check inAbstractContainerMenu::clickedso the-999ID can properly reach the subsequent drag-and-drop code blocks.AI Use Disclosure
I used AI as a search tool, find the code causing this bug.
Related Issues