forked from mirror/openmw-tes3mp
Merge remote-tracking branch 'scrawl/item' into next
This commit is contained in:
commit
71fc8f5830
1 changed files with 47 additions and 38 deletions
|
@ -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)
|
||||
|
||||
try
|
||||
{
|
||||
ManualRef ref (MWBase::Environment::get().getWorld()->getStore(), id);
|
||||
|
||||
if (ref.getPtr().getTypeName()==typeid (ESM::ItemLevList).name())
|
||||
|
@ -247,6 +249,13 @@ void MWWorld::ContainerStore::addInitialItem (const std::string& id, const std::
|
|||
ref.getPtr().getCellRef().mOwner = owner;
|
||||
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()
|
||||
|
|
Loading…
Reference in a new issue