diff --git a/modules/game_interface/widgets/uiitem.lua b/modules/game_interface/widgets/uiitem.lua index bc5ea741..ee4b8775 100644 --- a/modules/game_interface/widgets/uiitem.lua +++ b/modules/game_interface/widgets/uiitem.lua @@ -20,15 +20,26 @@ function UIItem:onDragLeave(droppedWidget, mousePos) end function UIItem:onDrop(widget, mousePos) - if not self:canAcceptDrop(widget, mousePos) then return false end + + if not self:canAcceptDrop(widget, mousePos) then + return false + end local item = widget.currentDragThing - if not item:isItem() then return false end - - local toPos = self.position + if not item:isItem() then + return false + end local itemPos = item:getPosition() - if itemPos.x == toPos.x and itemPos.y == toPos.y and itemPos.z == toPos.z then return false end + local itemTile = item:getTile() + if itemPos.x ~= 65535 and not itemTile then + return false + end + + local toPos = self.position + if itemPos.x == toPos.x and itemPos.y == toPos.y and itemPos.z == toPos.z then + return false + end if item:getCount() > 1 then modules.game_interface.moveStackableItem(item, toPos)