mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 19:44:54 +02:00
Fix issue with closing containers
* Wasn't clearing references properly.
This commit is contained in:
@@ -29,11 +29,15 @@ end
|
|||||||
|
|
||||||
function clean()
|
function clean()
|
||||||
for containerid,container in pairs(g_game.getContainers()) do
|
for containerid,container in pairs(g_game.getContainers()) do
|
||||||
if container.window then
|
destroy(container)
|
||||||
container.window:destroy()
|
end
|
||||||
container.window = nil
|
end
|
||||||
container.itemsPanel = nil
|
|
||||||
end
|
function destroy(container)
|
||||||
|
if container.window then
|
||||||
|
container.window:destroy()
|
||||||
|
container.window = nil
|
||||||
|
container.itemsPanel = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -103,7 +107,7 @@ function onContainerOpen(container, previousContainer)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function onContainerClose(container)
|
function onContainerClose(container)
|
||||||
if container.window then container.window:destroy() end
|
destroy(container)
|
||||||
end
|
end
|
||||||
|
|
||||||
function onContainerAddItem(container, slot, item)
|
function onContainerAddItem(container, slot, item)
|
||||||
|
Reference in New Issue
Block a user