forked from teamnwah/openmw-tes3coop
Use the new ContainerStore::remove method.
This commit is contained in:
parent
ffdb91bb21
commit
5f209b120b
1 changed files with 8 additions and 10 deletions
|
@ -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…
Reference in a new issue