1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 19:19:56 +00:00

[Client] Only add spells to players that are ensured to exist

This commit is contained in:
David Cernat 2017-08-31 06:42:11 +03:00
parent f6d36d5d80
commit c3d1eada89

View file

@ -648,8 +648,9 @@ void LocalPlayer::addSpells()
MWMechanics::Spells &ptrSpells = ptrPlayer.getClass().getCreatureStats(ptrPlayer).getSpells(); MWMechanics::Spells &ptrSpells = ptrPlayer.getClass().getCreatureStats(ptrPlayer).getSpells();
for (const auto &spell : spellbookChanges.spells) for (const auto &spell : spellbookChanges.spells)
ptrSpells.add(spell.mId); // Only add spells that are ensured to exist
if (MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().search(spell.mId))
ptrSpells.add(spell.mId);
} }
void LocalPlayer::addJournalItems() void LocalPlayer::addJournalItems()