Skip to content

Commit

Permalink
Fix backpack container bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jhaakma committed Aug 19, 2024
1 parent 4ad5206 commit 02a06fa
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ this.list.waterDirty = Activator:new{
ids = {}
}
this.list.water = this.list.waterDirty

this.list.waterClean = Activator:new{
name = "Water (Clean)",
type = this.types.waterSource,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ local function doEquip(self)
self:updateStats()
end

local function replaceAndEquip(self)
if not self:isCopy() then
self:replaceInInventory()
timer.frame.delayOneFrame(function()
doEquip(self)
end)
else
doEquip(self)
end
end

---@param self CarryableContainer
local function doOpen(self)
logger:debug("Opening backpack `%s`", self.item.id)
Expand All @@ -29,7 +40,7 @@ local callbacks = {
if CraftingFramework.Util.isQuickModifierDown() then
doOpen(self)
else
doEquip(self)
replaceAndEquip(self)
end
end,
---@param self CarryableContainer
Expand Down
3 changes: 3 additions & 0 deletions Data Files/MWSE/mods/mer/ashfall/interop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,9 @@ end
--- brewedOnly: boolean - (Default: true). If true, will only check for brewed tea
---@param e { id: string?, brewedOnly: boolean|nil } | nil
function Interop.hasTea(e)
if type(e) == "string" then
e = { id = e }
end
e = e or {}
for _, stack in pairs(tes3.player.object.inventory) do
if stack.variables then
Expand Down

0 comments on commit 02a06fa

Please sign in to comment.