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:
parent
b8e4f18751
commit
43074347e8
@ -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…
x
Reference in New Issue
Block a user