on character dead crash fix (function rewrite)

This commit is contained in:
Mestima 2021-10-04 20:47:24 +03:00
parent 633abca26f
commit cda33a69c2
No known key found for this signature in database
GPG Key ID: 30B59EB1D7F18807

View File

@ -5,24 +5,21 @@ local assets = {
local prefabs = {}
local function onopen(inst)
end
local function onclose(inst)
--[[
local owner = inst.components.inventoryitem.owner
if owner then
local container = owner.components.inventory:GetOverflowContainer()
if container then
local owner = inst and inst.components and inst.components.inventoryitem and inst.components.inventoryitem.owner or nil
if owner ~= nil then
local container = owner and owner.components and owner.components.inventory and owner.components.inventory:GetOverflowContainer() or nil
if container ~= nil then
container:Open(owner)
end
end
--]]
end
local function ondropped(inst)
if inst.components.container then
if inst.components.container ~= nil then
inst.components.container:Close()
end
end
@ -61,7 +58,7 @@ local function fn()
inst:AddComponent("container")
inst.components.container:WidgetSetup("pocketwatchpack")
--inst.components.container.onopenfn = onopen
--inst.components.container.onclosefn = onclose
inst.components.container.onclosefn = onclose
MakeHauntableLaunchAndDropFirstItem(inst)