From b17cc43fc618608bdefb99f13f53c01be9ed0b68 Mon Sep 17 00:00:00 2001 From: Henrique Santiago Date: Fri, 20 Jan 2012 02:27:36 -0200 Subject: [PATCH] fix container update item --- modules/game_containers/containers.lua | 1 + src/otclient/core/game.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/game_containers/containers.lua b/modules/game_containers/containers.lua index 61c9c4fa..59698924 100644 --- a/modules/game_containers/containers.lua +++ b/modules/game_containers/containers.lua @@ -98,6 +98,7 @@ function Containers.onContainerUpdateItem(containerId, slot, item) local itemWidget = container:getChildByIndex(slot + 1) if not itemWidget then return end itemWidget:setItem(item) + item:setPos(itemWidget.position) end function Containers.onContainerRemoveItem(containerId, slot) diff --git a/src/otclient/core/game.cpp b/src/otclient/core/game.cpp index cbc6d166..f75858fa 100644 --- a/src/otclient/core/game.cpp +++ b/src/otclient/core/game.cpp @@ -369,7 +369,12 @@ int Game::getThingStackpos(const ThingPtr& thing) // thing is at map if(thing->getPos().x != 65535) { 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