Fix issue with closing containers
* Wasn't clearing references properly.
This commit is contained in:
parent
28e70516a4
commit
2296e35174
|
@ -29,13 +29,17 @@ end
|
||||||
|
|
||||||
function clean()
|
function clean()
|
||||||
for containerid,container in pairs(g_game.getContainers()) do
|
for containerid,container in pairs(g_game.getContainers()) do
|
||||||
|
destroy(container)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function destroy(container)
|
||||||
if container.window then
|
if container.window then
|
||||||
container.window:destroy()
|
container.window:destroy()
|
||||||
container.window = nil
|
container.window = nil
|
||||||
container.itemsPanel = nil
|
container.itemsPanel = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
function refreshContainerItems(container)
|
function refreshContainerItems(container)
|
||||||
for slot=0,container:getCapacity()-1 do
|
for slot=0,container:getCapacity()-1 do
|
||||||
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue