fix container update item
This commit is contained in:
parent
f21927e8d9
commit
b17cc43fc6
|
@ -98,6 +98,7 @@ function Containers.onContainerUpdateItem(containerId, slot, item)
|
||||||
local itemWidget = container:getChildByIndex(slot + 1)
|
local itemWidget = container:getChildByIndex(slot + 1)
|
||||||
if not itemWidget then return end
|
if not itemWidget then return end
|
||||||
itemWidget:setItem(item)
|
itemWidget:setItem(item)
|
||||||
|
item:setPos(itemWidget.position)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Containers.onContainerRemoveItem(containerId, slot)
|
function Containers.onContainerRemoveItem(containerId, slot)
|
||||||
|
|
|
@ -369,7 +369,12 @@ int Game::getThingStackpos(const ThingPtr& thing)
|
||||||
// thing is at map
|
// thing is at map
|
||||||
if(thing->getPos().x != 65535) {
|
if(thing->getPos().x != 65535) {
|
||||||
TilePtr tile = g_map.getTile(thing->getPos());
|
TilePtr tile = g_map.getTile(thing->getPos());
|
||||||
return tile->getThingStackpos(thing);
|
if(tile)
|
||||||
|
return tile->getThingStackpos(thing);
|
||||||
|
else {
|
||||||
|
logError("could not get tile");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// thing is at container or inventory
|
// thing is at container or inventory
|
||||||
|
|
Loading…
Reference in New Issue