mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-25 05:41:33 +00:00
Prevent spell duplication
This commit is contained in:
parent
b8e4f18751
commit
43074347e8
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue