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:
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)
|
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()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue