diff --git a/src/game/items/CItemContainer.cpp b/src/game/items/CItemContainer.cpp index 2c13b964a..5914a75de 100644 --- a/src/game/items/CItemContainer.cpp +++ b/src/game/items/CItemContainer.cpp @@ -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(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(GetContainer()); + if (pCharContainerOwner) + { + iMaxWeight += (g_Cfg.Calc_MaxCarryWeight(pCharContainerOwner) + g_Cfg.m_iBackpackOverload); + } } if (iMaxWeight > 0 && (GetTotalWeight() + pItem->GetWeight() > iMaxWeight)) {