Use the new ContainerStore::remove method.

actorid
scrawl 11 years ago
parent ffdb91bb21
commit 5f209b120b

@ -2127,20 +2127,18 @@ namespace MWWorld
}
if (enchantment->mData.mType == ESM::Enchantment::CastOnce)
{
item.getRefData().setCount(item.getRefData().getCount()-1);
}
sourceName = item.getClass().getName(item);
if (!item.getRefData().getCount())
{
// Item was used up
MWBase::Environment::get().getWindowManager()->unsetSelectedSpell();
inv.setSelectedEnchantItem(inv.end());
if (!item.getContainerStore()->remove(item, 1, actor))
{
// Item was used up
MWBase::Environment::get().getWindowManager()->unsetSelectedSpell();
inv.setSelectedEnchantItem(inv.end());
}
}
else
MWBase::Environment::get().getWindowManager()->setSelectedEnchantItem(item); // Set again to show the modified charge
sourceName = item.getClass().getName(item);
effects = enchantment->mEffects;
}

Loading…
Cancel
Save