1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-22 00:23:51 +00:00

Merge remote-tracking branch 'scrawl/item' into next

This commit is contained in:
Marc Zinnschlag 2013-04-25 10:21:14 +02:00
commit 71fc8f5830

View file

@ -193,6 +193,8 @@ void MWWorld::ContainerStore::addInitialItem (const std::string& id, const std::
{ {
count = std::abs(count); /// \todo implement item restocking (indicated by negative count) count = std::abs(count); /// \todo implement item restocking (indicated by negative count)
try
{
ManualRef ref (MWBase::Environment::get().getWorld()->getStore(), id); ManualRef ref (MWBase::Environment::get().getWorld()->getStore(), id);
if (ref.getPtr().getTypeName()==typeid (ESM::ItemLevList).name()) if (ref.getPtr().getTypeName()==typeid (ESM::ItemLevList).name())
@ -248,6 +250,13 @@ void MWWorld::ContainerStore::addInitialItem (const std::string& id, const std::
addImp (ref.getPtr()); addImp (ref.getPtr());
} }
} }
catch (std::logic_error& e)
{
// Vanilla doesn't fail on nonexistent items in levelled lists
std::cerr << "Warning: ignoring nonexistent item '" << id << "'" << std::endl;
return;
}
}
void MWWorld::ContainerStore::clear() void MWWorld::ContainerStore::clear()
{ {