1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-26 06:40:22 +00:00

removed items by mods do not break cell loading

like fortify intelligence potions removed by sris_alchemy which break the
loading of the firewatch mages guild
This commit is contained in:
Emmanuel Anne 2015-09-24 16:42:10 +02:00
parent caa119f13c
commit 2fff6b06cc

View File

@ -411,6 +411,7 @@ void MWWorld::ContainerStore::fill (const ESM::InventoryList& items, const std::
void MWWorld::ContainerStore::addInitialItem (const std::string& id, const std::string& owner, void MWWorld::ContainerStore::addInitialItem (const std::string& id, const std::string& owner,
int count, bool topLevel, const std::string& levItem) int count, bool topLevel, const std::string& levItem)
{ {
try {
ManualRef ref (MWBase::Environment::get().getWorld()->getStore(), id, count); ManualRef ref (MWBase::Environment::get().getWorld()->getStore(), id, count);
if (ref.getPtr().getTypeName()==typeid (ESM::ItemLevList).name()) if (ref.getPtr().getTypeName()==typeid (ESM::ItemLevList).name())
@ -446,6 +447,12 @@ void MWWorld::ContainerStore::addInitialItem (const std::string& id, const std::
ref.getPtr().getCellRef().setOwner(owner); ref.getPtr().getCellRef().setOwner(owner);
addImp (ref.getPtr(), count); addImp (ref.getPtr(), count);
} }
}
catch (const std::exception& e)
{
std::cerr << "Error in MWWorld::ContainerStore::addInitialItem: " << e.what() << std::endl;
}
} }
void MWWorld::ContainerStore::restock (const ESM::InventoryList& items, const MWWorld::Ptr& ptr, const std::string& owner) void MWWorld::ContainerStore::restock (const ESM::InventoryList& items, const MWWorld::Ptr& ptr, const std::string& owner)