1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-23 11:39:41 +00:00

Add missing checks to see if spell still exists when loading a savegame (Bug #2883)

This commit is contained in:
scrawl 2015-08-21 14:24:34 +02:00
parent af3b0cd883
commit 52d8bc555c
2 changed files with 5 additions and 2 deletions

View file

@ -467,6 +467,7 @@ namespace MWGui
switch (keyType) switch (keyType)
{ {
case Type_Magic: case Type_Magic:
if (MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().search(id))
onAssignMagic(id); onAssignMagic(id);
break; break;
case Type_Item: case Type_Item:

View file

@ -1686,7 +1686,9 @@ namespace MWGui
else if (type == ESM::REC_ASPL) else if (type == ESM::REC_ASPL)
{ {
reader.getSubNameIs("ID__"); reader.getSubNameIs("ID__");
mSelectedSpell = reader.getHString(); std::string spell = reader.getHString();
if (MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().search(spell))
mSelectedSpell = spell;
} }
else if (type == ESM::REC_MARK) else if (type == ESM::REC_MARK)
{ {