diff --git a/apps/openmw/mwgui/tradeitemmodel.cpp b/apps/openmw/mwgui/tradeitemmodel.cpp index b4fa4e16f..e836355d3 100644 --- a/apps/openmw/mwgui/tradeitemmodel.cpp +++ b/apps/openmw/mwgui/tradeitemmodel.cpp @@ -146,27 +146,30 @@ namespace MWGui for (size_t i=0; igetItemCount(); ++i) { ItemStack item = mSourceModel->getItem(i); - MWWorld::Ptr base = item.mBase; - if (!mMerchant.isEmpty() && Misc::StringUtils::ciEqual(base.getCellRef().mRefID, "gold_001")) - continue; - if (!mMerchant.isEmpty() && !MWWorld::Class::get(base).canSell(base, services)) - continue; - - // don't show equipped items - if (mMerchant.getTypeName() == typeid(ESM::NPC).name()) + if(!mMerchant.isEmpty()) { - bool isEquipped = false; - MWWorld::InventoryStore& store = MWWorld::Class::get(mMerchant).getInventoryStore(mMerchant); - for (int slot=0; slotmTypeName : sEmptyString; - } - - Ptr (MWWorld::LiveCellRefBase *liveCellRef, CellStore *cell) - : mContainerStore (0) - { - mRef = liveCellRef; - mCell = cell; + if(mRef != 0) + return mRef->mTypeName; + throw std::runtime_error("Can't get type name from an empty object."); } template