Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/game/items/CItemContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -906,8 +906,12 @@ bool CItemContainer::CanContainerHold( const CItem *pItem, const CChar *pCharMsg
int iMaxWeight = m_ModMaxWeight;
if ((GetContainedLayer() == LAYER_PACK) && !(g_Cfg.m_iBackpackOverload <= -1))
{
CChar* pCharContainerOwner = static_cast<CChar*>(GetContainer()); // Owner of the container
iMaxWeight += (g_Cfg.Calc_MaxCarryWeight(pCharContainerOwner) + g_Cfg.m_iBackpackOverload);
// Allow more weight based on settings.
auto const *pCharContainerOwner = dynamic_cast<CChar*>(GetContainer());
if (pCharContainerOwner)
{
iMaxWeight += (g_Cfg.Calc_MaxCarryWeight(pCharContainerOwner) + g_Cfg.m_iBackpackOverload);
}
}
if (iMaxWeight > 0 && (GetTotalWeight() + pItem->GetWeight() > iMaxWeight))
{
Expand Down