1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-28 03:40:04 +00:00

Prevent spell duplication

This commit is contained in:
Evil Eye 2021-08-31 19:59:55 +02:00
parent b8e4f18751
commit 43074347e8

View File

@ -141,7 +141,7 @@ namespace MWMechanics
const ESM::Spell *spell = *iter;
if (filter(spell))
{
mSpells.erase(iter++);
iter = mSpells.erase(iter);
purged.push_back(spell->mId);
}
else
@ -204,7 +204,7 @@ namespace MWMechanics
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().search(id);
if (spell)
{
mSpells.emplace_back(spell);
addSpell(spell);
if (id == state.mSelectedSpell)
mSelectedSpell = id;