mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-27 04:41:34 +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;
|
const ESM::Spell *spell = *iter;
|
||||||
if (filter(spell))
|
if (filter(spell))
|
||||||
{
|
{
|
||||||
mSpells.erase(iter++);
|
iter = mSpells.erase(iter);
|
||||||
purged.push_back(spell->mId);
|
purged.push_back(spell->mId);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -204,7 +204,7 @@ namespace MWMechanics
|
||||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().search(id);
|
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().search(id);
|
||||||
if (spell)
|
if (spell)
|
||||||
{
|
{
|
||||||
mSpells.emplace_back(spell);
|
addSpell(spell);
|
||||||
|
|
||||||
if (id == state.mSelectedSpell)
|
if (id == state.mSelectedSpell)
|
||||||
mSelectedSpell = id;
|
mSelectedSpell = id;
|
||||||
|
|
Loading…
Reference in a new issue