|
|
@ -262,21 +262,15 @@ const ESM::Potion *MWMechanics::Alchemy::getRecord(const ESM::Potion& toFind) co
|
|
|
|
|
|
|
|
|
|
|
|
void MWMechanics::Alchemy::removeIngredients()
|
|
|
|
void MWMechanics::Alchemy::removeIngredients()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool needsUpdate = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (TIngredientsContainer::iterator iter (mIngredients.begin()); iter!=mIngredients.end(); ++iter)
|
|
|
|
for (TIngredientsContainer::iterator iter (mIngredients.begin()); iter!=mIngredients.end(); ++iter)
|
|
|
|
if (!iter->isEmpty())
|
|
|
|
if (!iter->isEmpty())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
iter->getContainerStore()->remove(*iter, 1, mAlchemist);
|
|
|
|
iter->getContainerStore()->remove(*iter, 1, mAlchemist);
|
|
|
|
|
|
|
|
|
|
|
|
if (iter->getRefData().getCount()<1)
|
|
|
|
if (iter->getRefData().getCount()<1)
|
|
|
|
{
|
|
|
|
|
|
|
|
needsUpdate = true;
|
|
|
|
|
|
|
|
*iter = MWWorld::Ptr();
|
|
|
|
*iter = MWWorld::Ptr();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (needsUpdate)
|
|
|
|
|
|
|
|
updateEffects();
|
|
|
|
updateEffects();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|