Fix dropping items outside menus

This commit is contained in:
Adem Kurt 2026-03-11 22:13:08 +03:00 committed by GitHub
parent 9e88dafef1
commit 62df888cb4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -157,7 +157,7 @@ shared_ptr<ItemInstance> AbstractContainerMenu::clicked(int slotIndex, int butto
shared_ptr<ItemInstance> clickedEntity = nullptr; shared_ptr<ItemInstance> clickedEntity = nullptr;
shared_ptr<Inventory> inventory = player->inventory; shared_ptr<Inventory> inventory = player->inventory;
if (slotIndex < 0 || slotIndex >= (int)slots.size()) if ((slotIndex < 0 || slotIndex >= (int)slots.size()) && slotIndex != SLOT_CLICKED_OUTSIDE)
return nullptr; return nullptr;
if (clickType == CLICK_QUICK_CRAFT) if (clickType == CLICK_QUICK_CRAFT)
@ -778,4 +778,4 @@ int AbstractContainerMenu::getRedstoneSignalFromContainer(shared_ptr<Container>
bool AbstractContainerMenu::isValidIngredient(shared_ptr<ItemInstance> item, int slotId) bool AbstractContainerMenu::isValidIngredient(shared_ptr<ItemInstance> item, int slotId)
{ {
return true; return true;
} }