mirror of
https://github.com/edubart/otclient.git
synced 2025-04-29 17:19:20 +02:00
Fix for moving creatures/items far out of reach
Fix to https://github.com/edubart/otclient/issues/1055
This commit is contained in:
parent
656dff45f1
commit
91a80017b4
@ -20,15 +20,26 @@ function UIItem:onDragLeave(droppedWidget, mousePos)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function UIItem:onDrop(widget, mousePos)
|
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
|
local item = widget.currentDragThing
|
||||||
if not item:isItem() then return false end
|
if not item:isItem() then
|
||||||
|
return false
|
||||||
local toPos = self.position
|
end
|
||||||
|
|
||||||
local itemPos = item:getPosition()
|
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
|
if item:getCount() > 1 then
|
||||||
modules.game_interface.moveStackableItem(item, toPos)
|
modules.game_interface.moveStackableItem(item, toPos)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user