fixed crash when character dies with open clock bag

This commit is contained in:
Mestima 2021-10-04 18:39:59 +03:00
parent 5f18a280b0
commit 923c09fdd5
No known key found for this signature in database
GPG Key ID: 30B59EB1D7F18807

View File

@ -10,6 +10,7 @@ local function onopen(inst)
end end
local function onclose(inst) local function onclose(inst)
--[[
local owner = inst.components.inventoryitem.owner local owner = inst.components.inventoryitem.owner
if owner then if owner then
local container = owner.components.inventory:GetOverflowContainer() local container = owner.components.inventory:GetOverflowContainer()
@ -17,14 +18,15 @@ local function onclose(inst)
container:Open(owner) container:Open(owner)
end end
end end
--]]
end end
local function ondropped(inst) local function ondropped(inst)
if inst.components.container then if inst.components.container then
inst.components.container:Close() inst.components.container:Close()
end end
end end
local function fn() local function fn()
local inst = CreateEntity() local inst = CreateEntity()
inst.entity:AddTransform() inst.entity:AddTransform()
@ -59,7 +61,7 @@ local function fn()
inst:AddComponent("container") inst:AddComponent("container")
inst.components.container:WidgetSetup("pocketwatchpack") inst.components.container:WidgetSetup("pocketwatchpack")
--inst.components.container.onopenfn = onopen --inst.components.container.onopenfn = onopen
inst.components.container.onclosefn = onclose --inst.components.container.onclosefn = onclose
MakeHauntableLaunchAndDropFirstItem(inst) MakeHauntableLaunchAndDropFirstItem(inst)