Don't Starve Together

Don't Starve Together

Syelza
Backpack Armor Fix (to the authors)
If you want the backpack to avoid sending things to the void when the armor config is on/true, add this code to fhl_bb.lua: (edit: can't seem to put tabs in here)

--add function after local assets braces (so after line 7, before the onequip function):

local function onbreak(owner, data)
local armor = data ~= nil and data.armor or nil
if armor and armor.components.container then
armor.components.container:DropEverything()
armor.components.container:Close()
armor:RemoveComponent("container")
end
end

--Before the end of onequip function, add this line:

inst:ListenForEvent("armorbroke", onbreak, owner)

--replace line inst.components.container:Close(owner) in onunequip function with:

if inst.components.container ~= nil then
inst.components.container:Close(owner)
end
inst:RemoveEventCallback("armorbroke", onbreak, owner)
Last edited by BoredPlayer13; 25 Dec, 2016 @ 9:52pm