fix: use right function in element:destroy()

This commit is contained in:
Kazhnuz 2021-08-30 14:59:06 +02:00
parent c95ff30d6e
commit 2065e4ce9c

View file

@ -35,9 +35,9 @@ end
function GuiElement:destroy()
local gui = self:getGui()
gui:removeElement(self.name)
if (self.screen == nil) then
self.screen:removeElement(self.name)
gui:deleteElement(self.name)
if (self.screen ~= nil) then
self.screen:deleteElement(self.name)
end
end