Encumbrance does not update when you drop items from a container. It only updates upon unloading or taking off/re-wearing the container.
Encumbrance should update as containers are emptied via dropping items from them, as otherwise you'll have an encumbrance 26 backpack with nothing in it.
Confirming. At least it was like this in experimentals a week ago.
Confirmed as well in 0.E-5236-ge7434cff45
It seems that when a backpack (or other container) has items inserted, its minimum encumbrance is permanently changed. Here I have five leather backpacks that were used to store various amounts of rags, but are now all empty and sitting on the floor. The W
ear menu shows they have different "Avg Encumbrance":
Edit Starting with a recent overhaul to the encumbrance system, I found that as of commit 8e60922 encumbrance works correctly. I started a git bisect
to narrow down where things went wrong since then, and will pursue a fix and new test case(s) if I can locate it.
Bug was introduced in b8080baa6 from #40745
Following up, I've learned that a container's encumbrance does correctly get updated when you remove items by these methods:
U
nloadi
nsert items from the backpackBut the cached encumbrance value is not updated when items are removed from the backpack in these ways:
d
ropping items to the groundD
rop items to the ground/
and drop from advanced inventory manager to the groundApparently, during these latter operations, item::on_contents_changed
needs to be called, so the cached encumbrance value can be updated.
This issue was partly resolved by #43108 - encumbrance now updates correctly when dropping with d
or D
.
Unfortunately, the issue still occurs when dropping items with advanced inventory manager.
Most helpful comment
Confirmed as well in 0.E-5236-ge7434cff45
It seems that when a backpack (or other container) has items inserted, its minimum encumbrance is permanently changed. Here I have five leather backpacks that were used to store various amounts of rags, but are now all empty and sitting on the floor. The
W
ear menu shows they have different "Avg Encumbrance":Edit Starting with a recent overhaul to the encumbrance system, I found that as of commit 8e60922 encumbrance works correctly. I started a
git bisect
to narrow down where things went wrong since then, and will pursue a fix and new test case(s) if I can locate it.Bug was introduced in b8080baa6 from #40745